summaryrefslogtreecommitdiffstats
path: root/zebra (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9488 from pguibert6WIND/fix_nhrp_neigh_stateRuss White2021-08-282-3/+15
|\ | | | | Fix nhrp neigh state
| * lib, zebra: complete the ndm flags on zclient apiPhilippe Guibert2021-08-261-2/+13
| | | | | | | | | | | | | | | | | | | | Insist on the fact that zclient neighbor state flags are mapped over netlink state flags. List all the defines currently known on kernel, and create a netlink API to convert netlink values to zclient values. The function is simplified as it is a 1-1 match. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * nhrp, zebra, lib: pass exact received neighbor state value to nhrpPhilippe Guibert2021-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As NHRP expects some notification of neighboring entries on GRE interface, when a new interface notification is encountered, the exact neighbor state flag is found. Previously, the flag passed to the upper layer was forced to NDM_STATE which is REACHABLE, as can be seen on below trace: 2021/08/25 10:58:39 NHRP: [QQ0NK-1H449] Netlink: new-neigh 102.1.1.1 dev gre1 lladdr 10.125.0.2 nud 0x2 cache used 1 type 5 When passing the real value, NHRP received an other value like STALE. 2021/08/25 11:28:44 NHRP: [QQ0NK-1H449] Netlink: new-neigh 102.1.1.1 dev gre1 lladdr 10.125.0.2 nud 0x4 cache used 0 type 5 This flag is important for NHRP, as it permits to monitor the link layer of NHRP entries. Fixes: d603c0774eba ("nhrp, zebra, lib: enforce usage of zapi_neigh_ip structure") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #9496 from idryzhov/vrf-cmd-init-unused-argDavid Lamparter2021-08-271-1/+1
|\ \ | | | | | | lib: remove unused argument from vrf_cmd_init
| * | lib: remove unused argument from vrf_cmd_initIgor Ryzhov2021-08-261-1/+1
| |/ | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #9331 from idryzhov/explicit-exitChristian Hopps2021-08-264-3/+8
|\ \ | |/ |/| *: explicitly print "exit" at the end of every node config
| * *: explicitly print "exit" at the end of every node configIgor Ryzhov2021-08-234-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a possibility that the same line can be matched as a command in some node and its parent node. In this case, when reading the config, this line is always executed as a command of the child node. For example, with the following config: ``` router ospf network 193.168.0.0/16 area 0 ! mpls ldp discovery hello interval 111 ! ``` Line `mpls ldp` is processed as command `mpls ldp-sync` inside the `router ospf` node. This leads to a complete loss of `mpls ldp` node configuration. To eliminate this issue and all possible similar issues, let's print an explicit "exit" at the end of every node config. This commit also changes indentation for a couple of existing exit commands so that all existing commands are on the same level as their corresponding node-entering commands. Fixes #9206. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #9466 from idryzhov/vrf-netnsDonatas Abraitis2021-08-262-0/+68
|\ \ | | | | | | lib, zebra: move vrf netns commands from lib to zebra
| * | lib, zebra: move vrf netns commands from lib to zebraIgor Ryzhov2021-08-232-0/+68
| |/ | | | | | | | | | | | | | | | | | | | | | | "[no] netns NAME" commands are part of the lib, but they are actually zebra-only: - they are using vrf_netns_handler_create and its description clearly says that it "should be called from zebra only" - vtysh sends these commands only to zebra - only zebra outputs the netns related config - zebra notifies other daemons about netns attachment Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* / *: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis2021-08-251-1/+0
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #9434 from anlancs/fix-zebra-mpls-cmdMark Stapp2021-08-231-14/+12
|\ | | | | zebra: fix wrong check of mpls command
| * zebra: fix wrong check of mpls commandanlan_cs2021-08-191-14/+12
| | | | | | | | | | | | | | | | | | | | Maybe with empty nexthop to call zebra_mpls_transit_lsp(): "no mpls lsp (16-1048575)". So just remove this "gate_str" check. If without "gate" in command, "gtype" is set to NEXTHOP_TYPE_BLACKHOLE for subsequent processing. Signed-off-by: anlan_cs <anlan_cs@tom.com>
* | zebra: Fix usage to enum in notify functionsDonald Sharp2021-08-192-7/+9
|/ | | | | | | | For some reason commit #ef524230a6baa decided to remove enums and switch to uint16_t. Which is not the right thing to do. Put it back Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* zebra: RTM_GETNEIGH messages may be used by nhrpPhilippe Guibert2021-08-171-13/+1
| | | | | | | | | | When NHRP registers to zebra to receive link layer events related to gre interfaces, then it is interested in receiving also RTM_GETNEIGH messages. Fixes ("b3b751046495") nhrpd: link layer registration to notifications Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge pull request #9380 from mjstapp/fix_static_lsp_cliRenato Westphal2021-08-162-18/+58
|\ | | | | zebra: mpls validation and static lsp fixes
| * zebra: mpls validation and static lsp fixesMark Stapp2021-08-122-18/+58
| | | | | | | | | | | | | | | | Handle TYPE_IFINDEX nexthops more consistently in a few places; be more specific about a few integer return values that were being treated as booleans. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* | Merge pull request #9389 from mjstapp/fix_netlink_if_name_saIgor Ryzhov2021-08-141-0/+8
|\ \ | | | | | | zebra: interface name must be a valid string
| * | zebra: interface name must be a valid stringMark Stapp2021-08-131-0/+8
| |/ | | | | | | | | | | Validate incoming netlink interface name strings. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* | Merge pull request #9371 from donaldsharp/zebra_evpn_getlIgor Ryzhov2021-08-131-0/+10
|\ \ | | | | | | zebra: Ensure stream is long enough
| * | zebra: Ensure stream is long enoughDonald Sharp2021-08-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | In zebra_evpn_proc_remote_nh if we do not pass in a long enough stream, the stream reads will fail. Ensure that we have enough data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #9374 from mjstapp/fix_nhg_add_leakDonald Sharp2021-08-121-0/+5
|\ \ \ | |/ / |/| | zebra: clean up nhg allocations in error path
| * | zebra: clean up nhg allocations in error pathMark Stapp2021-08-111-0/+5
| |/ | | | | | | | | | | Clean up allocated nhgs in error path in zread_nhg_add(). Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* | Merge pull request #9304 from donaldsharp/zebra_random_stuffMark Stapp2021-08-124-241/+64
|\ \ | | | | | | Zebra random stuff
| * | zebra: Delete rib_lookup_and_dump since it is not usedDonald Sharp2021-08-062-51/+0
| | | | | | | | | | | | | | | | | | The rib_lookup_and_dump function is never used, remove Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | zebra: Remove rib_lookup_and_pushup functionDonald Sharp2021-08-063-105/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rib_lookup_and_pushup function, from what I can tell, was used more when static route processing and connected routes were more closely integrated in zebra. The goal was when we were adding a new address to remove the connected route and then allow processing of the new address. With the re-org a few years ago to seperate out connected routes as well as static routes, I believe this is no longer needed. on BSD, without this code change we have this log: 2021/08/05 14:33:38 ZEBRA: [QEVVE-G3FQQ] rib_meta_queue_add: (0:0):10.40.30.0/24: queued rn 0x802022bb0 into sub-queue 4 2021/08/05 14:33:38 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 200 Type: RTM_DELETE 2021/08/05 14:33:38 ZEBRA: [V3NSB-BPKBD] Kernel: GATEWAY DONE PROTO1 2021/08/05 14:33:38 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 15 2021/08/05 14:33:38 ZEBRA: [MJD4M-0AAAR] Kernel: pid 53305, rtm_addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:33:38 ZEBRA: [Y9Y5K-JJ7NT] rtm_read: got rtm of type 2 (RTM_DELETE) addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:33:38 ZEBRA: [V17DT-1FJEN] kernel_rtm: 10.40.30.0/24: successfully did NH 9.8.6.7 2021/08/05 14:33:38 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 164 Type: RTM_NEWADDR 2021/08/05 14:33:38 ZEBRA: [V3NSB-BPKBD] Kernel: 2021/08/05 14:33:38 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 4664 2021/08/05 14:33:38 ZEBRA: [MJD4M-0AAAR] Kernel: pid 0, rtm_addrs {DST} 2021/08/05 14:33:38 ZEBRA: [M09CX-TKB4N] ifam_read_mesg: ifindex 1, ifname vtnet0, ifam_addrs {NETMASK,IFP,IFA,BRD}, ifam_flags 0x0, addr 10.40.30.1/24 broad 10.40.30.255 dst (unspec) gateway (unspec) 2021/08/05 14:33:38 ZEBRA: [MFYWV-KH3MC] rib_add_multipath_nhe: (0:0):10.40.30.0/24: Inserting route rn 0x802022bb0, re 0x8032973a0 (connected) existing 0x0, same_count 0 2021/08/05 14:33:38 ZEBRA: [Q4T2G-E2SQF] rib_add_multipath_nhe: dumping RE entry 0x8032973a0 for 10.40.30.0/24 vrf default(0) 2021/08/05 14:33:38 ZEBRA: [M5M58-9PD2R] 10.40.30.0/24: uptime == 1379355, type == 2, instance == 0, table == 0 2021/08/05 14:33:38 ZEBRA: [RVZMM-N7DME] 10.40.30.0/24: metric == 1, mtu == 0, distance == 0, flags == None status == None 2021/08/05 14:33:38 ZEBRA: [Q1NW5-NWY7P] 10.40.30.0/24: nexthop_num == 1, nexthop_active_num == 0 2021/08/05 14:33:38 ZEBRA: [TFHQ8-TC30H] 10.40.30.0/24: NH vtnet0[1] vrf default(0) with flags 2021/08/05 14:33:38 ZEBRA: [SCETK-GQ9E4] 10.40.30.0/24: dump complete 2021/08/05 14:33:38 ZEBRA: [QEVVE-G3FQQ] rib_meta_queue_add: (0:0):10.40.30.0/24: queued rn 0x802022bb0 into sub-queue 2 2021/08/05 14:33:38 ZEBRA: [MFYWV-KH3MC] rib_add_multipath_nhe: (0:?):10.40.30.0/24 (MRIB): Inserting route rn 0x802022f30, re 0x803297340 (connected) existing 0x0, same_count 0 2021/08/05 14:33:38 ZEBRA: [Q4T2G-E2SQF] rib_add_multipath_nhe: dumping RE entry 0x803297340 for 10.40.30.0/24 vrf default(0) 2021/08/05 14:33:38 ZEBRA: [M5M58-9PD2R] 10.40.30.0/24: uptime == 1379355, type == 2, instance == 0, table == 0 2021/08/05 14:33:38 ZEBRA: [RVZMM-N7DME] 10.40.30.0/24: metric == 1, mtu == 0, distance == 0, flags == None status == None 2021/08/05 14:33:38 ZEBRA: [Q1NW5-NWY7P] 10.40.30.0/24: nexthop_num == 1, nexthop_active_num == 0 2021/08/05 14:33:38 ZEBRA: [TFHQ8-TC30H] 10.40.30.0/24: NH vtnet0[1] vrf default(0) with flags 2021/08/05 14:33:38 ZEBRA: [SCETK-GQ9E4] 10.40.30.0/24: dump complete 2021/08/05 14:33:38 ZEBRA: [GCGMT-SQR82] rib_link: (0:?):10.40.30.0/24 (MRIB): rn 0x802022f30 adding dest 2021/08/05 14:33:38 ZEBRA: [QEVVE-G3FQQ] rib_meta_queue_add: (0:0):10.40.30.0/24 (MRIB): queued rn 0x802022f30 into sub-queue 2 2021/08/05 14:33:38 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 240 Type: RTM_ADD 2021/08/05 14:33:38 ZEBRA: [V3NSB-BPKBD] Kernel: UP PINNED 2021/08/05 14:33:38 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 0 2021/08/05 14:33:38 ZEBRA: [MJD4M-0AAAR] Kernel: pid 0, rtm_addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:33:38 ZEBRA: [K0KVE-2GJA1] default(0:0):10.40.30.0/24: Processing rn 0x802022bb0 2021/08/05 14:33:38 ZEBRA: [RWCK7-TX4HT] default(0:0):10.40.30.0/24: Examine re 0x8032973a0 (connected) status: Changed flags: None dist 0 metric 1 2021/08/05 14:33:38 ZEBRA: [RWCK7-TX4HT] default(0:0):10.40.30.0/24: Examine re 0x8032970a0 (static) status: None flags: Recursion RR Distance dist 1 metric 0 2021/08/05 14:33:38 ZEBRA: [NYYJJ-0Q8QG] default(0:0):10.40.30.0/24: After processing: old_selected 0x0 new_selected 0x8032973a0 old_fib 0x0 new_fib 0x8032973a0 2021/08/05 14:33:38 ZEBRA: [RT9DY-ZS2KN] default(0:0):10.40.30.0/24: Adding route rn 0x802022bb0, re 0x8032973a0 (connected) 2021/08/05 14:33:38 ZEBRA: [PP3BZ-RABJN] default(0:0):10.40.30.0/24: rn 0x802022bb0 dequeued from sub-queue 2 2021/08/05 14:33:38 ZEBRA: [K0KVE-2GJA1] default(0:0):10.40.30.0/24: Processing rn 0x802022f30 2021/08/05 14:33:38 ZEBRA: [RWCK7-TX4HT] default(0:0):10.40.30.0/24: Examine re 0x803297340 (connected) status: Changed flags: None dist 0 metric 1 2021/08/05 14:33:38 ZEBRA: [NYYJJ-0Q8QG] default(0:0):10.40.30.0/24: After processing: old_selected 0x0 new_selected 0x803297340 old_fib 0x0 new_fib 0x803297340 2021/08/05 14:33:38 ZEBRA: [RT9DY-ZS2KN] default(0:0):10.40.30.0/24: Adding route rn 0x802022f30, re 0x803297340 (connected) 2021/08/05 14:33:38 ZEBRA: [PP3BZ-RABJN] default(0:0):10.40.30.0/24: rn 0x802022f30 dequeued from sub-queue 2 2021/08/05 14:33:38 ZEBRA: [K0KVE-2GJA1] default(0:0):10.40.30.0/24: Processing rn 0x802022bb0 2021/08/05 14:33:38 ZEBRA: [RWCK7-TX4HT] default(0:0):10.40.30.0/24: Examine re 0x8032973a0 (connected) status: Queued flags: Selected dist 0 metric 1 2021/08/05 14:33:38 ZEBRA: [RWCK7-TX4HT] default(0:0):10.40.30.0/24: Examine re 0x8032970a0 (static) status: None flags: Recursion RR Distance dist 1 metric 0 2021/08/05 14:33:38 ZEBRA: [NYYJJ-0Q8QG] default(0:0):10.40.30.0/24: After processing: old_selected 0x8032973a0 new_selected 0x8032973a0 old_fib 0x8032973a0 new_fib 0x8032973a0 2021/08/05 14:33:38 ZEBRA: [PP3BZ-RABJN] default(0:0):10.40.30.0/24: rn 0x802022bb0 dequeued from sub-queue 4 2021/08/05 14:33:38 ZEBRA: [GHWHS-ZKQM5] update_from_ctx: default(0:0):10.40.30.0/24: SELECTED, re 0x8032973a0 2021/08/05 14:33:38 ZEBRA: [TS3SH-1276M] default(0:0):10.40.30.0/24 update_from_ctx(): no fib nhg 2021/08/05 14:33:38 ZEBRA: [HKQXC-4STSK] default(0:0):10.40.30.0/24 update_from_ctx(): rib nhg matched, changed 'false' 2021/08/05 14:33:38 ZEBRA: [HBZNK-5H1X0] (0:0):10.40.30.0/24: Redist update re 0x8032973a0 (connected), old 0x0 (None) 2021/08/05 14:33:38 ZEBRA: [GHWHS-ZKQM5] update_from_ctx: default(0:0):10.40.30.0/24: SELECTED, re 0x8032973a0 2021/08/05 14:33:38 ZEBRA: [TS3SH-1276M] default(0:0):10.40.30.0/24 update_from_ctx(): no fib nhg 2021/08/05 14:33:38 ZEBRA: [HKQXC-4STSK] default(0:0):10.40.30.0/24 update_from_ctx(): rib nhg matched, changed 'false' 2021/08/05 14:33:38 ZEBRA: [HBZNK-5H1X0] (0:0):10.40.30.0/24: Redist update re 0x8032973a0 (connected), old 0x0 (None) With this code change: 2021/08/05 14:41:24 ZEBRA: [MFYWV-KH3MC] rib_add_multipath_nhe: (0:?):10.10.40.0/24: Inserting route rn 0x802022f30, re 0x8021cbe60 (static) existing 0x0, same_count 0 2021/08/05 14:41:24 ZEBRA: [RT9DY-ZS2KN] default(0:0):10.10.40.0/24: Adding route rn 0x802022f30, re 0x8021cbe60 (static) 2021/08/05 14:41:24 ZEBRA: [V17DT-1FJEN] kernel_rtm: 10.10.40.0/24: successfully did NH 9.8.6.7 2021/08/05 14:41:24 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 200 Type: RTM_ADD 2021/08/05 14:41:24 ZEBRA: [V3NSB-BPKBD] Kernel: UP GATEWAY DONE PROTO1 2021/08/05 14:41:24 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 0 2021/08/05 14:41:24 ZEBRA: [MJD4M-0AAAR] Kernel: pid 60818, rtm_addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:41:24 ZEBRA: [Y9Y5K-JJ7NT] rtm_read: got rtm of type 1 (RTM_ADD) addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:41:24 ZEBRA: [TS3SH-1276M] default(0:0):10.10.40.0/24 update_from_ctx(): no fib nhg 2021/08/05 14:41:24 ZEBRA: [HKQXC-4STSK] default(0:0):10.10.40.0/24 update_from_ctx(): rib nhg matched, changed 'true' 2021/08/05 14:41:24 ZEBRA: [HBZNK-5H1X0] (0:0):10.10.40.0/24: Redist update re 0x8021cbe60 (static), old 0x0 (None) 2021/08/05 14:42:06 ZEBRA: [ZJ4AV-JEMJ3] dplane_intf_addr_set 2021/08/05 14:42:06 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 164 Type: RTM_NEWADDR 2021/08/05 14:42:06 ZEBRA: [V3NSB-BPKBD] Kernel: 2021/08/05 14:42:06 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 4664 2021/08/05 14:42:06 ZEBRA: [MJD4M-0AAAR] Kernel: pid 0, rtm_addrs {DST} 2021/08/05 14:42:06 ZEBRA: [M09CX-TKB4N] ifam_read_mesg: ifindex 1, ifname vtnet0, ifam_addrs {NETMASK,IFP,IFA,BRD}, ifam_flags 0x0, addr 10.10.40.3/24 broad 10.10.40.255 dst (unspec) gateway (unspec) 2021/08/05 14:42:06 ZEBRA: [MFYWV-KH3MC] rib_add_multipath_nhe: (0:0):10.10.40.0/24: Inserting route rn 0x802022f30, re 0x80308c4c0 (connected) existing 0x0, same_count 0 2021/08/05 14:42:06 ZEBRA: [MFYWV-KH3MC] rib_add_multipath_nhe: (0:?):10.10.40.0/24 (MRIB): Inserting route rn 0x802023160, re 0x80308c460 (connected) existing 0x0, same_count 0 2021/08/05 14:42:06 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 240 Type: RTM_ADD 2021/08/05 14:42:06 ZEBRA: [V3NSB-BPKBD] Kernel: UP PINNED 2021/08/05 14:42:06 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 0 2021/08/05 14:42:06 ZEBRA: [MJD4M-0AAAR] Kernel: pid 0, rtm_addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:42:06 ZEBRA: [RG9Y6-E93A0] default(0:0):10.10.40.0/24: Updating route rn 0x802022f30, re 0x80308c4c0 (connected) old 0x8021cbe60 (static) 2021/08/05 14:42:06 ZEBRA: [RT9DY-ZS2KN] default(0:0):10.10.40.0/24: Adding route rn 0x802023160, re 0x80308c460 (connected) 2021/08/05 14:42:06 ZEBRA: [THSYN-E2XFY][EC 100663299] rtm_write: write : Address already in use (48) 2021/08/05 14:42:06 ZEBRA: [RV5F2-MQGZG][EC 100663303] kernel_rtm: 10.10.40.0/24: rtm_write() unexpectedly returned -5 for command RTM_DELETE 2021/08/05 14:42:06 ZEBRA: [ZPR30-5G1FB] Kernel: Len: 200 Type: RTM_DELETE 2021/08/05 14:42:06 ZEBRA: [V3NSB-BPKBD] Kernel: UP PROTO1 2021/08/05 14:42:06 ZEBRA: [HDTM1-ENZNM] Kernel: message seq 1 2021/08/05 14:42:06 ZEBRA: [MJD4M-0AAAR] Kernel: pid 60818, rtm_addrs {DST,GATEWAY,NETMASK} 2021/08/05 14:42:06 ZEBRA: [XASXT-GF69Y] kernel_rtm: No useful nexthops were found in RIB prefix 10.10.40.0/24 2021/08/05 14:42:06 ZEBRA: [TS3SH-1276M] default(0:0):10.10.40.0/24 update_from_ctx(): no fib nhg 2021/08/05 14:42:06 ZEBRA: [HKQXC-4STSK] default(0:0):10.10.40.0/24 update_from_ctx(): rib nhg matched, changed 'false' 2021/08/05 14:42:06 ZEBRA: [HBZNK-5H1X0] (0:0):10.10.40.0/24: Redist update re 0x80308c4c0 (connected), old 0x8021cbe60 (static) netstat -rn: 10.10.40.0/24 link#1 U vtnet0 10.10.40.3 link#1 UHS lo0 show ip route: C>* 10.10.40.0/24 [0/1] is directly connected, vtnet0, 00:18:48 S 10.10.40.0/24 [1/0] via 9.8.6.7, vtnet0, weight 1, 00:19:30 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | zebra: `debug zebra kernel msgdump` is linux specificDonald Sharp2021-08-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | The command `debug zebra kernel msgdump is netlink specific. There is no point at all to allow this to be configed on non netlink platforms. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | zebra: Convert srcdest_rnode2str to %pRN in zebra_rib.cDonald Sharp2021-08-061-74/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | There were a bunch of places where we converted the route node to a prefix string via srcdest_rnode2str when we should have been using %pRN in zebra_rib.c. Just convert over the ones we should to use it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | zebra: short-circuit rib_process when nothing to doDonald Sharp2021-08-061-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are calling rib_process and the route_node in question has no dest, there is no work to do here at all. As such we should just return before attempting to do any other work. This is just a tiny bit of simplification being done. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #9367 from mjstapp/fix_rt_netlink_afDonald Sharp2021-08-111-0/+6
|\ \ \ | | | | | | | | zebra: ignore unknown address-family in netlink route msg
| * | | zebra: ignore unknown address-family in netlink route msgMark Stapp2021-08-101-0/+6
| | |/ | |/| | | | | | | | | | | | | | | | Ignore AFs we don't handle in incoming netlink route updates. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* | | Merge pull request #9236 from AnuradhaKaruppiah/v6-nh-rmacSri Mohana Singamsetty2021-08-102-5/+27
|\ \ \ | | | | | | | | zebra: use a separate dummy prefix for referencing v6 nexthops
| * | | zebra: use a separate dummy prefix for referencing v6 nexthopsAnuradha Karuppiah2021-07-302-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | v4 and v6 host/refernce prefixes need to be setup separately for [RMAC, VTEP] entries as the VTEP is always normalized to a v4 addr. Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
* | | | Merge pull request #9321 from donaldsharp/no_leak_reIgor Ryzhov2021-08-103-6/+25
|\ \ \ \ | |_|/ / |/| | | zebra: Prevent memory leak if route is rejected early
| * | | zebra: Properly note add/update for rib_add_multipath_nheDonald Sharp2021-08-093-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling rib_add_multipath_nhe ensure that we have well aligned return codes that mean something so that interersted parties can properly handle the situation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | | zebra: Prevent memory leak if route is rejected earlyDonald Sharp2021-08-091-0/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | When receiving a route via zapi, if the route is rejected there exists a code path where we would not free the corresponding re created. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | zebra: prevent crash when nhlfe is NULLDonald Sharp2021-08-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | There exists a call path where the nhlfe_alloc can return NULL for blackhole nexthops. In this case we were still trying to save the nhlfe pointer causing a crash when we attempted to add it to a self-contained list. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | zebra: don't use default case when switching over enum nexthopDonald Sharp2021-08-041-9/+17
|/ / | | | | | | | | | | | | | | | | Do not use the `default` case when switching over an enumerated type. This allows the code to fail to compile when we add a new enumeration. Thus allowing us developers to know all the places in the code we'll need to touch. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #9231 from idryzhov/zebra-rmap-set-srcRuss White2021-08-031-28/+0
|\ \ | | | | | | zebra: remove checks for src address existence when using "set src"
| * | zebra: remove checks for src address existence when using "set src"Igor Ryzhov2021-08-021-28/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | 1. This check is absolutely useless. Nothing keeps user from deleting the address right after this check. 2. This check prevents zebra from correctly reading the user config with "set src" because of a race with interface startup (see #4249). 3. NO OPERATIONAL DATA USAGE ON VALIDATION STAGE. Fixes #7319. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #9259 from opensourcerouting/moar-jsonRuss White2021-08-035-101/+652
|\ \ | | | | | | *: can't get enough JSON
| * | zebra: add "json" option to "show interface"Renato Westphal2021-08-025-101/+652
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | Merge pull request #9258 from mjstapp/fix_rule_strlcpyDonatas Abraitis2021-08-031-1/+1
|\ \ \ | | | | | | | | zebra: use strlcpy in dplane_rule_init
| * | | zebra: use strlcpy in dplane_rule_initMark Stapp2021-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use strlcpy for safety in dplane rule init api. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* | | | Merge pull request #9232 from idryzhov/interface-node-cleanupRenato Westphal2021-08-031-11/+1
|\ \ \ \ | |_|/ / |/| | | *: cleanup interface node installation
| * | | *: cleanup interface node installationIgor Ryzhov2021-07-291-11/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #9238 from leonshaw/fix/netns-deleteIgor Ryzhov2021-08-021-2/+0
|\ \ \ | |_|/ |/| | lib, zebra: Preserve user-configured VRF on netns deletion
| * | lib, zebra: Preserve user-configured VRF on netns deletionXiao Liang2021-07-301-2/+0
| |/ | | | | | | | | | | Don't clear VRF's user-configured flag when netns is deleted. Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
* / zebra: bugfix of error quit of zebra, due to no nexthop ACTIVEbatmancn2021-07-281-1/+3
|/ | | | | | | | | | | | | There exists some rare situations where fpm will attempt to send a route update with no valid nexthops. In that case an assert would be hit. This is not good for trying to keep your routing daemons up and running when we can safely just recover the situation. Fixes #7588 Signed-off-by: batmancn <batmanustc@gmail.com> <fixed commit message, and used zlog_err> Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9007 from donaldsharp/pbr_stuffJafar Al-Gharaibeh2021-07-277-16/+57
|\ | | | | add ability to match on proto to pbr
| * bgpd, pbrd, zebra: Encode/decode the ip proto from daemons to zebraDonald Sharp2021-07-081-0/+4
| | | | | | | | | | | | | | Ensure that we properly encode/decode the ip protocol from daemons to zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com>