Commit Graph

30591 Commits

Author SHA1 Message Date
Russ White
dd57a2c78e
Merge pull request #11882 from opensourcerouting/fix/increase_peer_af_flags_to_u64
bgpd: Increase peer af_flags to uint64_t
2022-09-06 11:24:39 -04:00
Russ White
f82192c8ad
Merge pull request #11754 from Orange-OpenSource/isisd
isisd: Correct Valgrind errors
2022-09-06 09:51:18 -04:00
Mark Stapp
85ba04f389 bgpd: release rcu lock in bgp keepalive pthread
Don't hold the rcu lock in the bgp keepalive pthread: it
blocks the rcu pthread and prevents log-file deletion.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-09-06 09:07:07 -04:00
Michal Ruprich
ec3bb054c3 ospfd: Adding SUPPORT_OSPF_API define in ospf_spf.c
It is not possible to build ospf_spf.c file with --disable-ospfapi because
ospf_apiserver.c has SUPPORT_OSPF_API around all function definitions and
that results in an undefined reference to the ospf_apiserver_notify_reachable
function error while building.

Signed-off-by: Michal Ruprich <mruprich@redhat.com>
2022-09-06 12:34:15 +02:00
Francois Dumontet
98654f4258 pathd: nai adjacency fix query type f for IPV6
This commit is dedicated to fix some issues in path_ted_query_type_f
function. Issues are related to IPv6 implementation.
-key is not based on the pertinent part of IPv6 address.
-test on memcmp return value is mismatch.
-wrong flag value tested (ipv4 against ipv6).
-return adj_sid was the wrong one.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-09-06 12:03:04 +02:00
Donatas Abraitis
7e7f61ed49 bgpd: Unlock bgp_dest after bgp_table_subtree_lookup()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-06 12:51:35 +03:00
Donatas Abraitis
a2af7147fe bgpd: Drop unused functions
bgp_node_match_ipv4
bgp_node_match_ipv6
bgp_table_iter_init
bgp_table_iter_next
bgp_table_iter_cleanup
bgp_table_iter_pause
bgp_table_iter_is_done
bgp_table_iter_started

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-06 12:51:35 +03:00
Donatas Abraitis
8c0044f323 bgpd: Unlock bgp_dest for some more cases
bgp_static_set()
bgp_aggregate_install()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-06 12:51:35 +03:00
Donatas Abraitis
636632c32f bgpd: Reuse prep_for_rmap_apply() when applying route-map for show cmd
Include extra path attributes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-06 12:51:34 +03:00
Donatas Abraitis
fd43ffd974 bgpd: Do not forget to unlock bgp_dest from update_advertise_vni_routes
If "unexpected" happens.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-06 11:49:08 +03:00
Sai Gomathi N
b40990228f pimd: Fixing alignment
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-06 00:15:38 -07:00
Sai Gomathi N
d891fa78e4 pimd, pim6d: Changing IGMP to GM in debug macros
Changing
PIM_DO_DEBUG_IGMP_EVENTS to PIM_DO_DEBUG_GM_EVENTS
PIM_DO_DEBUG_IGMP_PACKETS to PIM_DO_DEBUG_GM_PACKETS
PIM_DO_DEBUG_IGMP_TRACE to PIM_DO_DEBUG_GM_TRACE
PIM_DO_DEBUG_IGMP_TRACE_DETAIL to PIM_DO_DEBUG_GM_TRACE_DETAIL
PIM_DONT_DEBUG_IGMP_EVENTS to PIM_DONT_DEBUG_GM_EVENTS
PIM_DONT_DEBUG_IGMP_PACKETS to PIM_DONT_DEBUG_GM_PACKETS
PIM_DONT_DEBUG_IGMP_TRACE to PIM_DONT_DEBUG_GM_TRACE
PIM_DONT_DEBUG_IGMP_TRACE_DETAIL to PIM_DONT_DEBUG_GM_TRACE_DETAIL
PIM_MASK_IGMP_EVENTS to PIM_MASK_GM_EVENTS
PIM_MASK_IGMP_PACKETS to PIM_MASK_GM_PACKETS
PIM_MASK_IGMP_TRACE to PIM_MASK_GM_TRACE
PIM_MASK_IGMP_TRACE_DETAIL to PIM_MASK_GM_TRACE_DETAIL
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-06 00:15:38 -07:00
Abhishek N R
cb406d5cd7 pim6d: Adding additional details for "show ipv6 mld interface [ifname] json" command.
Added Robustness value, Query interval, Query response timer
and Last member query interval field in json output.

Issue: #11891

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-05 22:51:03 -07:00
Donatas Abraitis
451cebeec2
Merge pull request #11902 from SaiGomathiN/igmp-to-gm
pimd, pim6d: Changing IGMP to GM in debug macros
2022-09-06 08:40:43 +03:00
Philippe Guibert
6fc4929e09 bgpd: associate appropriate family for redistributed connected addresses
When redistributing connected addresses, the address family has
to be figured out. The calculation was not done, the next-hop
address length was not set, and as consequence, the nexthop
is displayed like if it was an ipv6 address, which is wrong for
ipv4 addresses.

Calculate the family for connected addresses.
Change the topotests accordingly.

Fixes: ("7226bc40d606") bgpd: ignore NEXT_HOP for MP_REACH_NLRI

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
b244203fcc topotests: add bgp_vpnv4_ebgp test with 'mpls bgp forwarding'
add bgp_vpnv4_ebgp using the 'mpls bgp forwarding' interface
command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
4cd690ae4d bgpd: add 'mpls bgp forwarding' to ease mpls vpn ebgp peering
RFC4364 describes peerings between multiple AS domains, to ease
the continuity of VPN services across multiple SPs. This commit
implements a sub-set of IETF option b) described in chapter 10 b.

The ASBR to ASBR approach is taken, with an EBGP peering between
the two routers. The EBGP peering must be directly connected to
the outgoing interface used. In those conditions, the next hop
is directly connected, and there is no need to have a transport
label to convey the VPN label. A new vty command is added on a
per interface basis:

This command if enabled, will permit to convey BGP VPN labels
without any transport labels (i.e. with implicit-null label).

restriction:
this command is used only for EBGP directly connected peerings.
Other use cases are not covered.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
6e616738ca topotests: add bgp vpnv4 over gre test
This test ensures that MPLS VPN routes can be installed into a
gre interface with route-map l3vpn next-hop encapsulation command
set. On the other hand, if this command is not set, incoming bgp
routes are not considered as valid.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
1bb550b63c bgpd: add resolution for l3vpn traffic over gre interfaces
When a route imported from l3vpn is analysed, the nexthop from default
VRF is looked up against a valid MPLS path. Generally, this is done on
backbones with a MPLS signalisation transport layer like LDP. Generally,
the BGP connection is multiple hops away. That scenario is already
working.

There is case where it is possible to run L3VPN over GRE interfaces, and
where there is no LSP path over that GRE interface: GRE is just here to
tunnel MPLS traffic. On that case, the nexthop given in the path does not
have MPLS path, but should be authorized to convey MPLS traffic provided
that the user permits it via a configuration command.

That commit introduces a new command that can be activated in route-map:
 > set l3vpn next-hop encapsulation gre

That command authorizes the nexthop tracking engine to accept paths that
o have a GRE interface as output, independently of the presence of an LSP
path or not.

A configuration example is given below. When bgp incoming vpnv4 updates
are received, the nexthop of NLRI is 192.168.0.2. Based on nexthop
tracking service from zebra, BGP knows that the output interface to reach
192.168.0.2 is r1-gre0. Because that interface is not MPLS based, but is
a GRE tunnel, then the update will be using that nexthop to be installed.

    interface r1-gre0
     ip address 192.168.0.1/24
    exit
    router bgp 65500
     bgp router-id 1.1.1.1
     neighbor 192.168.0.2 remote-as 65500
     !
     address-family ipv4 unicast
      no neighbor 192.168.0.2 activate
     exit-address-family
     !
     address-family ipv4 vpn
      neighbor 192.168.0.2 activate
      neighbor 192.168.0.2 route-map rmap in
     exit-address-family
    exit
    !
    router bgp 65500 vrf vrf1
     bgp router-id 1.1.1.1
     no bgp network import-check
     !
     address-family ipv4 unicast
      network 10.201.0.0/24
      redistribute connected
      label vpn export 101
      rd vpn export 444:1
      rt vpn both 52:100
      export vpn
      import vpn
     exit-address-family
    exit
    !
    route-map rmap permit 1
     set l3vpn next-hop encapsulation gre
    exit

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:25 +02:00
sri-mohan1
9e5fc01f00 bfdd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-09-05 14:12:25 +05:30
Sai Gomathi N
55eb347de9 pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to PIM_DEBUG_GM_PACKETS
Changing the macros to common so that it can be used for pimv6 debugs as well
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-04 22:46:09 -07:00
Sai Gomathi N
95b13dc512 pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTS
Changing the macros to common so that it can be used for pimv6 debugs as well
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-04 22:46:09 -07:00
Sarita Patra
deda3f27d3 pim6d: Update last_member_query_interval and last_member_query_count
When there is update in the configuration of last_member_query_interval
and last_member_query_count, call gm_ifp_update().
This will update cur_query_intv_trig and cur_lmqc of gm_ifp structure.

Issue: #11901

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-09-04 16:53:03 -07:00
Donatas Abraitis
324e8b1f79 bgpd: Handle Origin Validation State extended community via route-map match
Add an ability to match via route-maps. An additional route-map command

`match rpki-extcommunity <invalid|notfound|valid>` added.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-04 21:54:47 +03:00
Donatas Abraitis
7b27cf7bbd bgpd: Add Origin Validation State extended community
```
spine1-debian-11# sh ip bgp 100.100.100.101/32
BGP routing table entry for 100.100.100.101/32, version 21
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Local
    fe80::ca5d:fd0d:cd8:1bb7 from eth3 (172.17.0.3)
    (fe80::ca5d:fd0d:cd8:1bb7) (used)
      Origin incomplete, metric 0, localpref 100, valid, internal, best (First path received)
      Extended Community: OVS:invalid
      Last update: Wed Aug 31 19:31:46 2022

spine1-debian-11# sh ip bgp 100.100.100.100/32
BGP routing table entry for 100.100.100.100/32, version 17
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Local
    fe80::ca5d:fd0d:cd8:1bb7 from eth3 (172.17.0.3)
    (fe80::ca5d:fd0d:cd8:1bb7) (used)
      Origin incomplete, metric 0, localpref 100, valid, internal, best (First path received)
      Extended Community: OVS:not-found
      Last update: Wed Aug 31 19:31:46 2022
spine1-debian-11#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-04 21:23:59 +03:00
Donatas Abraitis
4880f5fa16 doc: Add rfc5668 to the list
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-04 21:23:59 +03:00
Donatas Abraitis
7139b1aeae
Merge pull request #11898 from sri-mohan1/sri-rip-dbg1
ripd: changes for code maintainability
2022-09-04 21:18:12 +03:00
Donatas Abraitis
9ad6c63528
Merge pull request #11897 from mobash-rasool/fixes2
pimd: Removal of unused function pim_neighbor_find_prefix
2022-09-04 21:16:59 +03:00
sri-mohan1
99404729cf ripd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-09-03 00:02:59 +05:30
Mobashshera Rasool
79c0c50db9 pimd: Removal of unused function pim_neighbor_find_prefix
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-09-02 09:50:28 -07:00
Olivier Dugeon
1fa6385040 isisd: Correct Valgrind errors
Runing most of isisd tests with --valgrind-memleaks give many memory errors.
This is due to the way isisd is stopped: performing a "no router isis XXX"
through CLI solves most of them. Indeed, isis_finish() doesn't call
isis_area_destroy() leaving many allocated memory unfreed.

This patch adds call to appropriate delete function or XFREE() when necessary to
properly free all alocated memory before terminating isisd.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2022-09-02 15:04:35 +02:00
Donatas Abraitis
1011b31a1c
Merge pull request #11884 from mjstapp/fix_cancel_ptrs
lib: ensure locals are inited to NULL
2022-09-02 13:49:10 +03:00
Donatas Abraitis
4ed967b375
Merge pull request #11888 from anlancs/fix/l2vni-vid-change
zebra: fix missing tenant vrf change notification
2022-09-02 13:21:44 +03:00
Donatas Abraitis
5761ca2faa
Merge pull request #11894 from sri-mohan1/sri-bgp-dbg1
bgpd: changes for code maintainability
2022-09-02 13:21:34 +03:00
Jafar Al-Gharaibeh
d9f11dc261
Merge pull request #11893 from kraj/master
configure: Check for readline() function instead of main
2022-09-01 17:09:01 -05:00
sri-mohan1
a10c287292 bgpd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-09-02 00:31:40 +05:30
Khem Raj
9399d58c13 configure: Check for readline() function instead of main
main is not a function found in libreadline, its better to check for a
function thats provided by it.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-09-01 10:45:36 -07:00
anlan_cs
a606d91561 zebra: fix missing tenant vrf change notification
zebra can change l2vni's tenant vrf with new `vid`, and then notify bgpd
to change also. But this notification is wrongly missed, so bgpd knows
nothing about it. It affects evpn routes, which are related to tenant vrf.
Need to notify bgpd of the `vid` change.

Changes l2vni 100 of vxlan's `vid` so as to change its svi interface from
default to vrf1, then check bgp's vni status.

Before: (Ignored irrelevent columns)
```
host#show bgp l2vpn evpn vni
  VNI      Type RD                    Tenant VRF
* 100      L2   66.66.66.66:2         default <- No change
```

After:(Ignored irrelevent columns)
```
host#show bgp l2vpn evpn vni
  VNI      Type RD                   Tenant VRF
* 100      L2   66.66.66.66:2        vrf1 <- Updated
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-09-01 03:08:16 -04:00
Manoj Naragund
b345a3d9b4 ospfd: Added clis to change default timers for LSA refresh and maxage remove delay.
Description:
Added hidden clis that will allow you to reset the default timers
for LSA refresh and LSA maxage remove delay, these will help in testing
LSA refresh scenarios in upcoming OSPFv2 Flood reduction feature(rfc4136).

IETF Link : https://datatracker.ietf.org/doc/html/rfc4136

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-08-31 23:10:09 -07:00
Mark Stapp
7e93a54c6c lib: ensure locals are inited to NULL
A couple of pointers in do_thread_cancel() we only inited at
the start of the function; make sure they're inited during
each iteration of the loop.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-08-31 11:47:39 -04:00
G. Paul Ziemba
80853c2ec7 bgpd: improve labelpool performance at scale
- double the size of each new chunk request from zebra
    - use bitfields to track label allocations in a chunk
    - When allocating:
        - skip chunks with no free labels
        - search biggest chunks first
        - start search in chunk where last search ended
    - Improve API documentation in comments (bgp_lp_get() and callback)
    - Tweak formatting of "show bgp labelpool chunks"
    - Add test features (compiled conditionally on BGP_LABELPOOL_ENABLE_TESTS)

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2022-08-31 08:21:27 -07:00
Donatas Abraitis
b6a3df6b48 bgpd: Drop useless comments for peer af flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-31 14:39:38 +03:00
Donatas Abraitis
da5e1a58e9 bgpd: Increase peer af_flags to uint64_t
Increasing in advance, as we already hitting the current limit.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-31 14:35:55 +03:00
Donald Sharp
f1f38efd83
Merge pull request #11879 from mobash-rasool/fixes2
pim6d: Fix the Code for MLD in the show pim state command
2022-08-30 15:09:36 -04:00
Donald Sharp
36e4d2915f
Merge pull request #11878 from opensourcerouting/fix/some_nits
bgpd: A couple of minor findings
2022-08-30 15:06:29 -04:00
Russ White
d72c279d08
Merge pull request #11833 from opensourcerouting/feature/bgp_neighbor_soo
bgpd: Add `neighbor soo` command
2022-08-30 11:17:53 -04:00
Russ White
72cb87b8e4
Merge pull request #11852 from gpnaveen/bgp_admin_dist
tests: adding bgp admin distance topotests.
2022-08-30 11:13:30 -04:00
Donatas Abraitis
40e65d74b6
Merge pull request #11866 from anlancs/fix/evpn-l2vni
zebra: fix missing vni transition
2022-08-30 18:13:02 +03:00
Rafael Zalamena
464ae6a654
Merge pull request #11870 from rgirada/ospf_gr_crash
ospfd: crash when router acts as GR helper upon a topo change
2022-08-30 10:10:15 -03:00
Philippe Guibert
d1adb44843 bgpd: support TCP keepalive for BGP connection
TCP keepalive is enabled once BGP connection is established.

New vty commands:

bgp tcp-keepalive <1-65535> <1-65535> <1-30>
no bgp tcp-keepalive

Signed-off-by: Xiaofeng Liu <xiaofeng.liu@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-08-30 15:09:28 +02:00