]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #7764 from pguibert6WIND/nhrp_shortcut_routes
Jafar Al-Gharaibeh [Fri, 12 Feb 2021 19:34:40 +0000 (13:34 -0600)]
Merge pull request #7764 from pguibert6WIND/nhrp_shortcut_routes

nhrp: fix shortcut routes

3 years agoMerge pull request #8039 from m-varasteh/master
Quentin Young [Fri, 12 Feb 2021 18:32:44 +0000 (13:32 -0500)]
Merge pull request #8039 from m-varasteh/master

[filter]: change return code for errors

3 years agoMerge pull request #8006 from idryzhov/fix-bfd-lookup
Philippe Guibert [Fri, 12 Feb 2021 17:25:09 +0000 (18:25 +0100)]
Merge pull request #8006 from idryzhov/fix-bfd-lookup

bfdd: fix session lookup

3 years agoMerge pull request #8065 from donaldsharp/foo_master
Donatas Abraitis [Fri, 12 Feb 2021 15:04:59 +0000 (17:04 +0200)]
Merge pull request #8065 from donaldsharp/foo_master

bgpd: When deleting a neighbor from a peer-group the PGNAME is optional

3 years agoMerge pull request #8063 from ton31337/fix/typo_enum_bestpath
Mark Stapp [Thu, 11 Feb 2021 19:59:40 +0000 (14:59 -0500)]
Merge pull request #8063 from ton31337/fix/typo_enum_bestpath

bgpd: Replace typo "Cluser length" => "Cluster length"

3 years agoMerge pull request #7915 from kssoman/ospf_test
Quentin Young [Thu, 11 Feb 2021 19:47:49 +0000 (14:47 -0500)]
Merge pull request #7915 from kssoman/ospf_test

3 years agobgpd: When deleting a neighbor from a peer-group the PGNAME is optional
Donald Sharp [Thu, 11 Feb 2021 18:35:22 +0000 (13:35 -0500)]
bgpd: When deleting a neighbor from a peer-group the PGNAME is optional

Currently when deleting a neighbor from a peer-group:
no neighbor A.B.C.D peer-group FOO

We must specify FOO, while A.B.C.D is sufficient enough of an
identifier to know what to do.

Make PGNAME optional on this command and just delete the peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8060 from donaldsharp/ospf_vrf_baloney
Mark Stapp [Thu, 11 Feb 2021 16:58:15 +0000 (11:58 -0500)]
Merge pull request #8060 from donaldsharp/ospf_vrf_baloney

ospfd:  Prevent duplicate packet read in certain vrf situations

3 years agobgpd: Replace typo "Cluser length" => "Cluster length"
Donatas Abraitis [Thu, 11 Feb 2021 15:10:20 +0000 (17:10 +0200)]
bgpd: Replace typo "Cluser length" => "Cluster length"

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoospfd: Prevent duplicate packet read in certain vrf situations
Donald Sharp [Thu, 11 Feb 2021 12:31:05 +0000 (07:31 -0500)]
ospfd:  Prevent duplicate packet read in certain vrf situations

Currently if the sysctl net.ipv4.raw_l3mdev_accept is 1, packets
destined to a specific vrf also end up being delivered to the default
vrf.  We will see logs like this in ospf:

2021/02/10 21:17:05.245727 OSPF: ospf_recv_packet: fd 20(default) on interface 1265(swp1s1.26)
2021/02/10 21:17:05.245740 OSPF: Hello received from [9.9.36.12] via [swp1s1.26:200.254.26.13]
2021/02/10 21:17:05.245741 OSPF:  src [200.254.26.14],
2021/02/10 21:17:05.245743 OSPF:  dst [224.0.0.5]
2021/02/10 21:17:05.245769 OSPF: ospf_recv_packet: fd 45(vrf1036) on interface 1265(swp1s1.26)
2021/02/10 21:17:05.245774 OSPF: Hello received from [9.9.36.12] via [swp1s1.26:200.254.26.13]
2021/02/10 21:17:05.245775 OSPF:  src [200.254.26.14],
2021/02/10 21:17:05.245777 OSPF:  dst [224.0.0.5]

This really really makes ospf unhappy in the vrf we are running in.

I am approaching the problem by just dropping the packet if read in the
default vrf because of:

commit 0556fc33c7275c2a3b00047a536976f8dbf7cbb3
Author: Donald Sharp <sharpd@cumulusnetworks.com>
Date:   Fri Feb 1 11:54:59 2019 -0500

    lib: Allow bgp to always create a listen socket for the vrf

Effectively if we have `router ospf vrf BLUE` but no ospf running
in the default vrf, we will not have a listener and that would
require a fundamental change in our approach to handle the ospf->fd
at a global level.  I think this is less than ideal at the moment
but it will get us moving again and allow FRR to work with
a bunch of vrf's and ospf neighbors.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agonhrpd: replace nhrp route nexthop with onlink route when prefix=nh
Philippe Guibert [Thu, 30 Jul 2020 16:16:16 +0000 (18:16 +0200)]
nhrpd: replace nhrp route nexthop with onlink route when prefix=nh

There are cases where nhrp wants to create a nhrp route to gre interface
with the nexthop which is the same the prefix. This is the case with
ipv6:

ipv6 route a:ff::ff:4/128 via a:ff::ff:4:/128 dev gre1

This route entry is false from zebra point of view, and to avoid that,
the nexthop is ignored in nhrp only if the prefix equals the nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agonhrpd: shortcut routes installed with nexthop.
Philippe Guibert [Thu, 23 Jul 2020 06:57:05 +0000 (08:57 +0200)]
nhrpd: shortcut routes installed with nexthop.

Previously, when a shortcut entry was created, its associated route was
created on system, with no nexthop, only gre device. eg:

[..]
N>* 192.168.2.0/24 [10/0] is directly connected, gre1, 00:01:04           <--- can not be resolved

[..]
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2              <---- correct

This situation was forcing neighbor resolution on the first outgoing packet matching the route entry. for instance 192.168.2.1 could not be resolved at link layer, and was going to fail. Instead, nhrp nexthop should have been used.
This is what this commit intends to do, that is to say that when a
shortcut is installed by nhrp, the associated nexthop entry is used.

[..]
N>* 192.168.2.0/24 [10/0] via 10.255.255.2, gre1 onlink, 00:00:31

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoospf6d : fix issue in ecmp inter area route
Soman K S [Wed, 10 Feb 2021 11:15:22 +0000 (16:45 +0530)]
ospf6d : fix issue in ecmp inter area  route

Issue: When a path in the inter area ecmp route is deleted, the route is removed

Fix: The fix is to remove the specific path from the inter area route using
     ospf6_abr_old_route_remove() when abr route entry is not found.
     In  the function ospf6_abr_old_route_remove() the path to be removed needs
     to match adv router and link state ID

     Fixed memory leak in ospf6_intra_prefix_update_route_origin() caused by
     route node lock not getting released.

Signed-off-by: kssoman <somanks@gmail.com>
3 years agoMerge pull request #8033 from qlyoung/fix-gnu-readline-bracketed-paste
Donatas Abraitis [Wed, 10 Feb 2021 09:01:18 +0000 (11:01 +0200)]
Merge pull request #8033 from qlyoung/fix-gnu-readline-bracketed-paste

vtysh: disable bracketed paste in readline

3 years agoMerge pull request #7508 from sudhanshukumar22/zebra-vrf-delete
Stephen Worley [Wed, 10 Feb 2021 07:05:10 +0000 (02:05 -0500)]
Merge pull request #7508 from sudhanshukumar22/zebra-vrf-delete

zebra: treat vrf add for existing vrf as update

3 years agoMerge pull request #7917 from pjdruddy/l3vpn-mpls-snmp-upstream-1
Martin Winter [Wed, 10 Feb 2021 00:37:58 +0000 (01:37 +0100)]
Merge pull request #7917 from pjdruddy/l3vpn-mpls-snmp-upstream-1

L3vpn mpls snmp upstream 1

3 years agoMerge pull request #8048 from idryzhov/fix-vrf-command
Philippe Guibert [Tue, 9 Feb 2021 20:43:54 +0000 (21:43 +0100)]
Merge pull request #8048 from idryzhov/fix-vrf-command

vrf: mark vrf as configured when entering vrf node

3 years agoMerge pull request #8045 from ton31337/feature/doc_ebgp_multihop_with_nht_resolve
Donald Sharp [Tue, 9 Feb 2021 19:59:26 +0000 (14:59 -0500)]
Merge pull request #8045 from ton31337/feature/doc_ebgp_multihop_with_nht_resolve

doc: We have to enable nht tracking via default route multihop eBGP

3 years agovrf: use wrappers to change VRF_CONFIGURED flag
Igor Ryzhov [Tue, 9 Feb 2021 19:39:32 +0000 (22:39 +0300)]
vrf: use wrappers to change VRF_CONFIGURED flag

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agovrf: mark vrf as configured when entering vrf node
Igor Ryzhov [Tue, 9 Feb 2021 18:38:45 +0000 (21:38 +0300)]
vrf: mark vrf as configured when entering vrf node

The VRF must be marked as configured when user enters "vrf NAME" command.

Otherwise, the following problem occurs:

`ip link add red type vrf table 1`

  VRF structure is allocated.

`vtysh -c "conf t" -c "vrf red"`

  `lib_vrf_create` is called, and pointer to the VRF structure is stored
  to the nb_config_entry.

`ip link del red`

  VRF structure is freed (because it is not marked as configured), but
  the pointer is still stored in the nb_config_entry.

`vtysh -c "conf t" -c "no vrf red"`

  Nothing happens, because VRF structure doesn't exist. It means that
  `lib_vrf_destroy` is not called, and nb_config_entry still exists in
  the running config with incorrect pointer.

`ip link add red type vrf table 1`

  New VRF structure is allocated.

`vtysh -c "conf t" -c "vrf red"`

  `lib_vrf_create` is NOT called, because the nb_config_entry for that
  VRF name still exists in the running config.

After that all NB commands for this VRF will use incorrect pointer to
the freed VRF structure.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: mplsL3vpn SNMP topotest
Pat Ruddy [Thu, 29 Oct 2020 15:44:27 +0000 (15:44 +0000)]
tests: mplsL3vpn SNMP topotest

Tests to exercise the MPLS-L3VPN-STD MIB

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7973 from sworleys/Pbr-More-Fixes
Russ White [Tue, 9 Feb 2021 12:37:09 +0000 (07:37 -0500)]
Merge pull request #7973 from sworleys/Pbr-More-Fixes

zebra,pbrd,doc: PBR more fixes

3 years agoMerge pull request #7980 from gromit1811/fix_ospf6_lsa_str_oob
Russ White [Tue, 9 Feb 2021 12:36:29 +0000 (07:36 -0500)]
Merge pull request #7980 from gromit1811/fix_ospf6_lsa_str_oob

Fix ospf6 LSA formatting out-of-bounds access

3 years agoMerge pull request #8042 from donaldsharp/smaller_timers_blackhole
Donatas Abraitis [Tue, 9 Feb 2021 10:04:33 +0000 (12:04 +0200)]
Merge pull request #8042 from donaldsharp/smaller_timers_blackhole

tests: Modify timers on bgp_blackhole_community

3 years agodoc: We have to enable nht tracking via default route multihop eBGP
Donatas Abraitis [Tue, 9 Feb 2021 09:51:45 +0000 (11:51 +0200)]
doc: We have to enable nht tracking via default route multihop eBGP

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8027 from ton31337/fix/remove_json_aggregatorasmalformed
Donald Sharp [Tue, 9 Feb 2021 01:11:54 +0000 (20:11 -0500)]
Merge pull request #8027 from ton31337/fix/remove_json_aggregatorasmalformed

bgpd: Remove aggregatorAsMalformed related outputs JSON and non-JSON

3 years agotests: Modify timers on bgp_blackhole_community
Donald Sharp [Thu, 28 Jan 2021 12:56:57 +0000 (07:56 -0500)]
tests: Modify timers on bgp_blackhole_community

Modify the timers on the bgp_blackhole_community test to
be more aggressive so our test system will recover faster
when we drop packets.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8028 from ton31337/fix/aggregator_dump_attributes_if_zero
Donald Sharp [Mon, 8 Feb 2021 21:02:17 +0000 (16:02 -0500)]
Merge pull request #8028 from ton31337/fix/aggregator_dump_attributes_if_zero

bgpd: Dump BGP attrs to check what's the actual prefix with aggr_as 0

3 years agoMerge pull request #8038 from imzyxwvu/same-attr
Donald Sharp [Mon, 8 Feb 2021 20:31:43 +0000 (15:31 -0500)]
Merge pull request #8038 from imzyxwvu/same-attr

bgpd: Do not compare attr again.

3 years ago[filter]: change return code for errors
varasteh [Mon, 8 Feb 2021 12:28:47 +0000 (15:58 +0330)]
[filter]: change return code for errors

CMD_WARNING is replaced by CMD_WARNING_CONFIG_FAILED

Signed-off-by: varasteh <mahdy.varasteh@gmail.com>
3 years agobgpd: Do not compare attr again.
zyxwvu Shi [Mon, 8 Feb 2021 12:09:02 +0000 (20:09 +0800)]
bgpd: Do not compare attr again.

`same_attr` has been computed and `hook_call(bgp_process)` (calling
BMP module) would not change it. We could reuse the value to filter
same attribute updates, avoiding an extra comparison.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
3 years agoMerge pull request #8032 from donaldsharp/dp_uninited
Donatas Abraitis [Mon, 8 Feb 2021 10:03:25 +0000 (12:03 +0200)]
Merge pull request #8032 from donaldsharp/dp_uninited

Some bfd valgrind issues

3 years agoMerge pull request #8031 from donaldsharp/duplicate
Donatas Abraitis [Mon, 8 Feb 2021 08:04:14 +0000 (10:04 +0200)]
Merge pull request #8031 from donaldsharp/duplicate

bgpd: Remove the double decleration of bgp_global_evpn_node_lookup

3 years agoMerge pull request #7946 from ckishimo/ospfv3_json_2
Quentin Young [Mon, 8 Feb 2021 06:23:25 +0000 (01:23 -0500)]
Merge pull request #7946 from ckishimo/ospfv3_json_2

tests: add ospf6 support via json files

3 years agoMerge pull request #8030 from anlancs/fix-pim-debug-double-check
Quentin Young [Mon, 8 Feb 2021 05:43:06 +0000 (00:43 -0500)]
Merge pull request #8030 from anlancs/fix-pim-debug-double-check

Fix double check, remove one

3 years agovtysh: disable bracketed paste in readline
Quentin Young [Mon, 8 Feb 2021 01:15:24 +0000 (20:15 -0500)]
vtysh: disable bracketed paste in readline

GNU Readline 8.1 enables bracketed paste by default. This results in
newlines not ending the readline() call, which breaks the ability of
users to paste in configs to vtysh's interactive shell.

Disable bracketed paste.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
3 years agopimd: check debug flag one time
anlancs [Mon, 8 Feb 2021 01:15:22 +0000 (09:15 +0800)]
pimd: check debug flag one time

    debug flag checked twice, just keep one.

Signed-off-by: anlancs <anlan_cs@tom.com>
3 years agobfdd: Prevent use after free ( again )
Donald Sharp [Sun, 7 Feb 2021 20:03:51 +0000 (15:03 -0500)]
bfdd: Prevent use after free ( again )

Valgrind is still reporting:

466020-==466020==    by 0x11B9F4: main (bfdd.c:403)
466020-==466020==  Address 0x5a7d544 is 84 bytes inside a block of size 272 free'd
466020:==466020==    at 0x48399AB: free (vg_replace_malloc.c:538)
466020-==466020==    by 0x490A947: qfree (memory.c:140)
466020-==466020==    by 0x48F2AE8: if_delete (if.c:322)
466020-==466020==    by 0x48F250D: if_destroy_via_zapi (if.c:195)
466020-==466020==    by 0x497071E: zclient_interface_delete (zclient.c:2040)
466020-==466020==    by 0x49745F6: zclient_read (zclient.c:3687)
466020-==466020==    by 0x4955AEC: thread_call (thread.c:1684)
466020-==466020==    by 0x48FF64E: frr_run (libfrr.c:1126)
466020-==466020==    by 0x11B9F4: main (bfdd.c:403)
466020-==466020==  Block was alloc'd at
466020:==466020==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
466020-==466020==    by 0x490A805: qcalloc (memory.c:115)
466020-==466020==    by 0x48F23D6: if_new (if.c:160)
466020-==466020==    by 0x48F257F: if_create_name (if.c:214)
466020-==466020==    by 0x48F3493: if_get_by_name (if.c:558)
466020-==466020==    by 0x49705F2: zclient_interface_add (zclient.c:1989)
466020-==466020==    by 0x49745E0: zclient_read (zclient.c:3684)
466020-==466020==    by 0x4955AEC: thread_call (thread.c:1684)
466020-==466020==    by 0x48FF64E: frr_run (libfrr.c:1126)
466020-==466020==    by 0x11B9F4: main (bfdd.c:403)

Apparently the bs->ifp pointer is being set even in cases when
the bs->key.ifname is not being set.  So go through and just
match the interface pointer and cut-to-the-chase.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years ago*: Fix usage of bfd_adj_event
Donald Sharp [Sun, 7 Feb 2021 19:59:53 +0000 (14:59 -0500)]
*: Fix usage of bfd_adj_event

Valgrind reports:

469901-==469901==
469901-==469901== Conditional jump or move depends on uninitialised value(s)
469901:==469901==    at 0x3A090D: bgp_bfd_dest_update (bgp_bfd.c:416)
469901-==469901==    by 0x497469E: zclient_read (zclient.c:3701)
469901-==469901==    by 0x4955AEC: thread_call (thread.c:1684)
469901-==469901==    by 0x48FF64E: frr_run (libfrr.c:1126)
469901-==469901==    by 0x213AB3: main (bgp_main.c:540)
469901-==469901==  Uninitialised value was created by a stack allocation
469901:==469901==    at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376)
469901-==469901==
469901-==469901== Conditional jump or move depends on uninitialised value(s)
469901:==469901==    at 0x3A093C: bgp_bfd_dest_update (bgp_bfd.c:421)
469901-==469901==    by 0x497469E: zclient_read (zclient.c:3701)
469901-==469901==    by 0x4955AEC: thread_call (thread.c:1684)
469901-==469901==    by 0x48FF64E: frr_run (libfrr.c:1126)
469901-==469901==    by 0x213AB3: main (bgp_main.c:540)
469901-==469901==  Uninitialised value was created by a stack allocation
469901:==469901==    at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376)

On looking at bgp_bfd_dest_update the function call into bfd_get_peer_info
when it fails to lookup the ifindex ifp pointer just returns leaving
the dest and src prefix pointers pointing to whatever was passed in.

Let's do two things:

a) The src pointer was sometimes assumed to be passed in and sometimes not.
Forget that.  Make it always be passed in
b) memset the src and dst pointers to be all zeros.  Then when we look
at either of the pointers we are not making decisions based upon random
data in the pointers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Remove the double decleration of bgp_global_evpn_node_lookup
Donald Sharp [Sun, 7 Feb 2021 12:35:38 +0000 (07:35 -0500)]
bgpd: Remove the double decleration of bgp_global_evpn_node_lookup

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Dump BGP attrs to check what's the actual prefix with aggr_as 0
Donatas Abraitis [Sat, 6 Feb 2021 11:57:42 +0000 (13:57 +0200)]
bgpd: Dump BGP attrs to check what's the actual prefix with aggr_as 0

Just for more debug information regarding malformed aggregator_as.

```
bgpd[5589]: [EC 33554434] 192.168.10.25: AGGREGATOR AS number is 0 for aspath: 65030
bgpd[5589]: bgp_attr_aggregator: attributes: nexthop 192.168.10.25, origin i, path 65030
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Remove aggregatorAsMalformed related outputs JSON and non-JSON
Donatas Abraitis [Sat, 6 Feb 2021 11:45:30 +0000 (13:45 +0200)]
bgpd: Remove aggregatorAsMalformed related outputs JSON and non-JSON

Already not necessary, because if BGP aggregator AS attribute is with
value of 0, then the attribute is already discarded at early processing.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise
Quentin Young [Fri, 5 Feb 2021 19:30:55 +0000 (14:30 -0500)]
Merge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise

tests: update EVPN VXLAN for SVI behaviour change

3 years agoMerge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retval
Quentin Young [Fri, 5 Feb 2021 19:08:37 +0000 (14:08 -0500)]
Merge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retval

ospf6d: Fix LSA formatting inconsistent retvals

3 years agoMerge pull request #8019 from ton31337/fix/bgpd_aggregator_0
Donald Sharp [Fri, 5 Feb 2021 17:33:29 +0000 (12:33 -0500)]
Merge pull request #8019 from ton31337/fix/bgpd_aggregator_0

bgpd: Unset only aggregator flag when AGGREGATOR_AS is 0

3 years agoMerge pull request #7218 from kuldeepkash/multicast_pim_bsm
Donald Sharp [Fri, 5 Feb 2021 15:20:15 +0000 (10:20 -0500)]
Merge pull request #7218 from kuldeepkash/multicast_pim_bsm

tests: Add multicast-pim-bsm-topo1 suite

3 years agobgpd: Unset only aggregator flag when AGGREGATOR_AS is 0
Donatas Abraitis [Fri, 5 Feb 2021 14:47:55 +0000 (16:47 +0200)]
bgpd: Unset only aggregator flag when AGGREGATOR_AS is 0

Avoid mangling packet size which is expected to be the same as received.

Stream pointer advancing is necessary to avoid changing the packet and
reseting BGP sessions.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7126 from vijaykug/multicast_with_static_rp
Donald Sharp [Fri, 5 Feb 2021 14:37:40 +0000 (09:37 -0500)]
Merge pull request #7126 from vijaykug/multicast_with_static_rp

tests: Add multicast-pim-static-rp-topo1 test suite

3 years agoMerge pull request #7998 from volta-networks/fix_isis_attach_bit
Donald Sharp [Thu, 4 Feb 2021 23:46:19 +0000 (18:46 -0500)]
Merge pull request #7998 from volta-networks/fix_isis_attach_bit

isisd: When adjacencies go up and down add support to modify attached-bit

3 years agoMerge pull request #8010 from ton31337/fix/drop_aggregate_as_attribute_if_malformed
Mark Stapp [Thu, 4 Feb 2021 20:02:42 +0000 (15:02 -0500)]
Merge pull request #8010 from ton31337/fix/drop_aggregate_as_attribute_if_malformed

bgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO

3 years agoMerge pull request #7709 from donaldsharp/vrf_doc
Mark Stapp [Thu, 4 Feb 2021 18:53:07 +0000 (13:53 -0500)]
Merge pull request #7709 from donaldsharp/vrf_doc

zebra: Slightly touch on the vrf route lookup semantics

3 years agoMerge pull request #8009 from pjdruddy/evpn-cleanup
Donald Sharp [Thu, 4 Feb 2021 18:37:24 +0000 (13:37 -0500)]
Merge pull request #8009 from pjdruddy/evpn-cleanup

zebra: resolve multiple functions for local MAC delete

3 years agoMerge pull request #7961 from mobash-rasool/ospfv3-feature
Mark Stapp [Thu, 4 Feb 2021 18:32:34 +0000 (13:32 -0500)]
Merge pull request #7961 from mobash-rasool/ospfv3-feature

ospf6d: add CLI to control maximum paths for routes.

3 years agoMerge pull request #8007 from wesleycoakley/xcompile-writeup
Mark Stapp [Thu, 4 Feb 2021 18:31:49 +0000 (13:31 -0500)]
Merge pull request #8007 from wesleycoakley/xcompile-writeup

doc: cross compilation guide

3 years agoMerge pull request #7941 from donaldsharp/instance_data
Mark Stapp [Thu, 4 Feb 2021 17:16:15 +0000 (12:16 -0500)]
Merge pull request #7941 from donaldsharp/instance_data

zebra: Display instance id as part of `show zebra client summ`

3 years agodoc: Slightly touch on the vrf route lookup semantics
Donald Sharp [Thu, 10 Dec 2020 12:38:52 +0000 (07:38 -0500)]
doc: Slightly touch on the vrf route lookup semantics

People keep asking about the default unreachable route
in the linux vrf table.  Add a bit of color about the
design choices and what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Display instance id as part of `show zebra client summ`
Donald Sharp [Wed, 27 Jan 2021 13:21:14 +0000 (08:21 -0500)]
zebra: Display instance id as part of `show zebra client summ`

When displaying `show zebra client summ` when we have instances
running, display the instance number as well.

New Output:

sharpd@eva ~/frr7 (instance_data)> vtysh -c "show zebra client summ"
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
ospf[1]       00:00:02     00:00:02    00:00:02       0/0              0/0
ospf[5]       00:00:02     00:00:02    00:00:02       0/0              0/0
sharp         00:00:02     00:00:02    00:00:02       0/0              0/0
static        00:00:02     00:00:02    00:00:02       0/0              0/0
Routes column shows (added+updated)/deleted

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #6049 from sarav511/ovrdhold
Russ White [Thu, 4 Feb 2021 12:14:31 +0000 (07:14 -0500)]
Merge pull request #6049 from sarav511/ovrdhold

pimd: SGRpt prune received during prune didn't override holdtime

3 years agoMerge pull request #8013 from mjstapp/fix_topo_ospf6_topo1
Donald Sharp [Thu, 4 Feb 2021 00:59:49 +0000 (19:59 -0500)]
Merge pull request #8013 from mjstapp/fix_topo_ospf6_topo1

tests: fix ospf6_topo1 missing ref files

3 years agobfdd: fix session lookup
Igor Ryzhov [Tue, 2 Feb 2021 22:02:15 +0000 (01:02 +0300)]
bfdd: fix session lookup

BFD key has optional fields "local" and "ifname" which can be empty when
the BFD session is created. In this case, the hash key will be calculated
with these fields filled with zeroes.

Later, when we're looking for the BFD session using the key with fields
"local" and "ifname" populated with actual values, the hash key will be
different. To work around this issue, we're doing multiple hash lookups,
first with full key, then with fields "local" and "ifname" filled with
zeroes.

But there may be another case when the initial key has the actual values
for "local" and "ifname", but the key we're using for lookup has empty
values. This case is covered for IPv4 by using additional hash walk with
bfd_key_lookup_ignore_partial_walker function but is not covered for IPv6.

Instead of introducing more hacks and workarounds, the following solution
is proposed:
- the hash key is always calculated in bfd_key_hash_do using only
  required fields
- the hash data is compared in bfd_key_hash_cmp, taking into account the
  fact that fields "local" and "ifname" may be empty

Using this solution, it's enough to make only one hash lookup.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: fix ospf6_topo1 missing ref files
Mark Stapp [Wed, 3 Feb 2021 21:28:18 +0000 (16:28 -0500)]
tests: fix ospf6_topo1 missing ref files

Only one of the four reference files was present; add the missing
three. The test just silently passed if a ref file was missing:
change that to a failure.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agodoc: cross compilation guide
Wesley Coakley [Tue, 2 Feb 2021 23:16:51 +0000 (18:16 -0500)]
doc: cross compilation guide

Wrote a little guide for cross-compiling FRR, gleaned from notes I took
while compiling for a RPi 3B+ on a Gentoo x86_64 system.

Care was taken to keep this documentation as generic as possible so
these steps could be applied to any cross-compile targeting a supported
architecture.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
3 years agoMerge pull request #8004 from opensourcerouting/xref-cxx
Donald Sharp [Wed, 3 Feb 2021 16:23:15 +0000 (11:23 -0500)]
Merge pull request #8004 from opensourcerouting/xref-cxx

lib/xref: fix C++ issues

3 years agobgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO
Donatas Abraitis [Wed, 3 Feb 2021 12:58:23 +0000 (14:58 +0200)]
bgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO

An UPDATE message that contains the AS number of zero in the AS_PATH
   or AGGREGATOR attribute MUST be considered as malformed and be
   handled by the procedures specified in [RFC7606].

An UPDATE message with a malformed AGGREGATOR attribute SHALL be
   handled using the approach of "attribute discard".

Attribute discard: In this approach, the malformed attribute MUST
      be discarded and the UPDATE message continues to be processed.
      This approach MUST NOT be used except in the case of an attribute
      that has no effect on route selection or installation.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: resolve multiple functions for local MAC delete
Pat Ruddy [Mon, 1 Jun 2020 13:33:30 +0000 (14:33 +0100)]
zebra: resolve multiple functions for local MAC delete

the old VXLAN function for local MAC deletion was still in
existence and being called from the VXLAN code whilst the new
generic function was not being called at all. Resolve this so
the generic function matches the old function and is called
exclusively.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib/xref: fix initializer order for C++
David Lamparter [Tue, 2 Feb 2021 18:27:41 +0000 (19:27 +0100)]
lib/xref: fix initializer order for C++

[v2: drop designated initializer names]

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #7449 from sudhanshukumar22/bgp-update-connect-timer
Donatas Abraitis [Wed, 3 Feb 2021 10:15:04 +0000 (12:15 +0200)]
Merge pull request #7449 from sudhanshukumar22/bgp-update-connect-timer

bgpd: config connect timer not applied immediately for non-established peers.

3 years agolib/xref: fix frrtrace() calls in thread code
David Lamparter [Tue, 2 Feb 2021 20:05:50 +0000 (21:05 +0100)]
lib/xref: fix frrtrace() calls in thread code

This didn't exist yet when the xref code came around, and since
frrtrace() gets collapsed to nothing by the preprocessor when
tracepoints are disabled, it didn't cause any compiler errors...

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: work around GCC bug 41091
David Lamparter [Tue, 2 Feb 2021 18:38:38 +0000 (19:38 +0100)]
lib/xref: work around GCC bug 41091

gcc fucks up global variables with section attributes when they're used
in templated C++ code.  The template instantiation "magic" kinda breaks
down (it's implemented through COMDAT in the linker, which clashes with
the section attribute.)

The workaround provides full runtime functionality, but the xref
extraction tool (xrelfo.py) won't work on C++ code compiled by GCC.

FWIW, clang gets this right.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: restore lost extern "C" beginning
David Lamparter [Tue, 2 Feb 2021 18:27:41 +0000 (19:27 +0100)]
lib/xref: restore lost extern "C" beginning

The `}` is still there, but the `extern "C" {` got lost somewhere,
probably in a rebase...

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #8002 from idryzhov/fix-all-backets
Mark Stapp [Tue, 2 Feb 2021 20:42:58 +0000 (15:42 -0500)]
Merge pull request #8002 from idryzhov/fix-all-backets

*: fix all backets

3 years agoMerge pull request #8001 from ton31337/fix/bgpd_replace_65535_with_const
Quentin Young [Tue, 2 Feb 2021 18:43:15 +0000 (13:43 -0500)]
Merge pull request #8001 from ton31337/fix/bgpd_replace_65535_with_const

bgpd: Replace 65535 with UINT16_MAX

3 years ago*: fix all backets
Igor Ryzhov [Tue, 2 Feb 2021 16:11:25 +0000 (19:11 +0300)]
*: fix all backets

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #7314 from kuldeepkash/multicast-sm-topo1
Donald Sharp [Tue, 2 Feb 2021 15:43:09 +0000 (10:43 -0500)]
Merge pull request #7314 from kuldeepkash/multicast-sm-topo1

Add multicast-pim-sm-topo1 test suite

3 years agobgpd: Replace 65535 with UINT16_MAX
Donatas Abraitis [Tue, 2 Feb 2021 08:28:18 +0000 (10:28 +0200)]
bgpd: Replace 65535 with UINT16_MAX

Just consistent.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #6766 from opensourcerouting/xref
Russ White [Tue, 2 Feb 2021 12:44:21 +0000 (07:44 -0500)]
Merge pull request #6766 from opensourcerouting/xref

lib: xrefs - general cross-references & unique IDs

3 years agoMerge pull request #7987 from donaldsharp/eigrp_mtu_correct
Russ White [Tue, 2 Feb 2021 12:31:55 +0000 (07:31 -0500)]
Merge pull request #7987 from donaldsharp/eigrp_mtu_correct

eigrpd: Correctly set the mtu for eigrp packets sent

3 years agoMerge pull request #7991 from donaldsharp/valgrind_cleanups1
Russ White [Tue, 2 Feb 2021 12:30:06 +0000 (07:30 -0500)]
Merge pull request #7991 from donaldsharp/valgrind_cleanups1

Valgrind cleanups

3 years agobgpd: config connect timer is not applied immediately for peers in non-established...
sudhanshukumar22 [Wed, 4 Nov 2020 05:21:42 +0000 (21:21 -0800)]
bgpd: config connect timer is not applied immediately for peers in non-established state.

Description:
When user is config connect timer, it doesn't reflect
immediately. It reflect when next time neighbor is tried to reconnect.

Problem Description/Summary :
When user is config connect timer, it doesn't reflect
The network connection was aborted by the local system.d to reconnect.
Fix is to update the connect timer immediately if BGP
    session is not in establish state.

Expected Behavior :
If neighbor is not yet established, we should immediately apply the config connect timer to the peer.

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
3 years agobgpd: update traps to RFC4273 Notifications
Pat Ruddy [Tue, 3 Nov 2020 17:05:24 +0000 (17:05 +0000)]
bgpd: update traps to RFC4273 Notifications

The old bgpTraps group was obsolteted by RFC4273 and the
bgpNotifications groups was introduces. The new notifications
mirror the bgpTraps except that an extra item peerRemoteAddr
is sent in the notification. This upgrades the support to
conform with RFC4273

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgp: add mplsl3vpn notifications
Pat Ruddy [Wed, 21 Oct 2020 17:28:41 +0000 (18:28 +0100)]
bgp: add mplsl3vpn notifications

Add support for mplsL3VpnVrfUp and mplsL3VpnVrfDown notifications
from [RFC4382]

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: allow traps with differently indexed objects
Pat Ruddy [Wed, 21 Oct 2020 17:22:06 +0000 (18:22 +0100)]
lib: allow traps with differently indexed objects

The function smux_trap only allows the paaasin of one index which is
applied to all indexed objects. However there is a requirement for
differently indexed objects within a singe trap. This commit
introduces a new function smux_trap_multi_index which can be called
with an array of indices. If this array is onf length 1 the original
smux_trap behaviour is maintained. smux_trap now calls the new
function with and index array length of 1 to avoid changes to
existing callers.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: implement mplsL3VpnVrfRtTable
Pat Ruddy [Wed, 14 Oct 2020 11:53:07 +0000 (12:53 +0100)]
bgpd: implement mplsL3VpnVrfRtTable

add code to support the route target table from [RFC4382]

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: expose ecommunity string length
Pat Ruddy [Wed, 14 Oct 2020 11:50:53 +0000 (12:50 +0100)]
bgpd: expose ecommunity string length

Expose the max ecommunity string length for range checking
in SNMP route-target string processing.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add SNMP support for mplsL3VpnRte Table
Pat Ruddy [Mon, 12 Oct 2020 15:47:52 +0000 (16:47 +0100)]
bgpd: add SNMP support for mplsL3VpnRte Table

Add MIB support for the route table in RFC4382

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: add SNMP_OCTET macro
Pat Ruddy [Mon, 25 Jan 2021 16:37:45 +0000 (16:37 +0000)]
lib: add SNMP_OCTET macro

Add SNMP macro to allow a singe octet to be returned

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: add IANA defines and IPv6 macro
Pat Ruddy [Mon, 12 Oct 2020 15:45:56 +0000 (16:45 +0100)]
lib: add IANA defines and IPv6 macro

Add defines for IANA SNMP routing protocol values
Add macro for returning an IPv6 address to the SNMP agent.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add mplsL3VpnVrfPerfTable support
Pat Ruddy [Fri, 2 Oct 2020 11:45:08 +0000 (12:45 +0100)]
bgpd: add mplsL3VpnVrfPerfTable support

support for counts of per-vrf routes:
added
deleted
current

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add SNMP mplsL3vpnIfConfTable support
Pat Ruddy [Thu, 1 Oct 2020 11:11:11 +0000 (12:11 +0100)]
bgpd: add SNMP mplsL3vpnIfConfTable support

Add infrastucture to return the mplsL3vpnIfConfTable from
[RFC4382]

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: add utilities to encode/decode an int in SNMP oid
Pat Ruddy [Thu, 1 Oct 2020 11:09:01 +0000 (12:09 +0100)]
lib: add utilities to encode/decode an int in SNMP oid

Add 2 functions to encode/decode intergers to/from SNMP OIDs. Make
sure oid is in network format.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: add utility to get the next index in a vrf
Pat Ruddy [Thu, 1 Oct 2020 11:06:50 +0000 (12:06 +0100)]
lib: add utility to get the next index in a vrf

Add if_vrf_lookup_by_index_next to get the next ifindex in a vrf
given the previous ifindex or 0 for the first.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd, lib: add mplsL3VpnVrf table
Pat Ruddy [Mon, 28 Sep 2020 15:35:35 +0000 (16:35 +0100)]
bgpd, lib: add mplsL3VpnVrf table

Add SNMP support for L3vpn Vrf table as defined in [RFC4382]
Keep track of vrf status for the table and for future traps.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add MPLSVPN SNMP boilerplate
Pat Ruddy [Fri, 18 Sep 2020 09:24:22 +0000 (10:24 +0100)]
bgpd: add MPLSVPN SNMP boilerplate

Add infrastructure for mplsvpn MIB (RFC-4382) and the top level
ScalarGroup.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add utility to check if a vrf is MPLS VPN
Pat Ruddy [Fri, 18 Sep 2020 09:20:43 +0000 (10:20 +0100)]
bgpd: add utility to check if a vrf is MPLS VPN

If a vrf is exporting to a vpn table and/or importing to a vpn
table then it is assumed t be a MPLS VPN vrf.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: add utility to check if a vrf is active
Pat Ruddy [Fri, 18 Sep 2020 09:12:08 +0000 (10:12 +0100)]
bgpd: add utility to check if a vrf is active

From RFC4382:
A VRF is
up(1) when there is at least one interface associated
with the VRF whose ifOperStatus is up(1).  A VRF is
down(2) when:
a. There does not exist at least one interface whose
   ifOperStatus is up(1).
b. There are no interfaces associated with the VRF.

Run through interfaces associated with a vrf and return
true if there is one in the up state.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib: add utility to count interfaces connected to a vrf
Pat Ruddy [Fri, 18 Sep 2020 09:05:54 +0000 (10:05 +0100)]
lib: add utility to count interfaces connected to a vrf

Run through the vrf's interface list and return a count, skipping
the l3mdev which has a name which matches the vrf name.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7985 from donaldsharp/eigrp_uninited
Donatas Abraitis [Tue, 2 Feb 2021 07:14:24 +0000 (09:14 +0200)]
Merge pull request #7985 from donaldsharp/eigrp_uninited

bunch of valgrind issues

3 years agoMerge pull request #7992 from donaldsharp/bgp_locks
Donatas Abraitis [Tue, 2 Feb 2021 07:13:33 +0000 (09:13 +0200)]
Merge pull request #7992 from donaldsharp/bgp_locks

bgpd: Centralize the dest unlocking for adj_out data structure

3 years agoMerge pull request #7402 from ranjanyash54/dev_2
Donald Sharp [Tue, 2 Feb 2021 02:07:57 +0000 (21:07 -0500)]
Merge pull request #7402 from ranjanyash54/dev_2

ospf6d: Json support added for command "show ipv6 ospf6 route [json]"

3 years agoMerge pull request #7994 from opensourcerouting/disable-printf-n
Donald Sharp [Tue, 2 Feb 2021 01:41:27 +0000 (20:41 -0500)]
Merge pull request #7994 from opensourcerouting/disable-printf-n

lib/printf: disable `%n` specifier