Commit Graph

32852 Commits

Author SHA1 Message Date
Donatas Abraitis
202c73c5d5
Merge pull request #14075 from donaldsharp/bgp_memory_fun
Remove unused memory allocations associated with bgp
2023-07-21 23:14:29 +03:00
Sindhu Parvathi Gopinathan
fadf87f358 zebra: non pretty json output for evpn route
Currently, json output of evpn route command are no pretty format.
This is an extremely expensive operation at high VNI scale

EVPN json non-pretty command support added:

```
show evpn mac vni <vni-id> detail json
show evpn vni detail json
```

Ticket:#3513256
Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-07-21 10:15:25 -07:00
Sindhu Parvathi Gopinathan
1c67c0951b zebra: non pretty json output for show ip route
Currently, json output of show ip route command are no pretty format.
This is an extremely expensive operation at high scale
(with high number of routes with many paths).

Zebra json non-pretty command support added:

```
show ip route json
```

Ticket:#3513256

Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-07-21 10:15:11 -07:00
Donald Sharp
bdc1762405 bgpd: Replace peer->ibuf_scratch
The peer->ibuf_scratch was allocating 65535 * 10 bytes
for scratch space to hold data incoming from a read
from a peer.  When you have 4k peers this is 262,1400,000
or 262 mb of data.  Which is crazy large.  Especially
since the i/o pthread is reading per peer without
any chance of having the data interfere with other reads.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 13:10:03 -04:00
Donald Sharp
4215e8011b bgpd: Remove withdraw_low from system, it is never used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 12:46:31 -04:00
Donald Sharp
c81d6d4d5f bgpd: Remove peer->sync array
It is never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 12:41:35 -04:00
Donald Sharp
acf4defcd8 bgpd: Remove peer->obuf_work
This is never used.  Free up another 65k of stream data
never used per peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 12:30:20 -04:00
G. Paul Ziemba
9835196ec9 pbrd: fix coverity issue
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-21 09:15:40 -07:00
Donald Sharp
b157af0ac1 bgpd: Remove peer->scratch
This was only ever being allocated and de-allocated.
Let's save 65k per peer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 12:14:59 -04:00
Mark Stapp
90f1e4e017
Merge pull request #14065 from opensourcerouting/bfd-label-doc
doc: remove BFD label command references
2023-07-21 08:59:50 -04:00
Donald Sharp
ada7353089 zebra: Remove unused functionality
The nl_rta_putXXX functions are never used.  Let's just remove them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 07:31:04 -04:00
Donald Sharp
cc66dff0a3 bgpd: Cleanup bgp_zebra_announce_default to be cleaner
Over time the bgp_zebra_announce_default function has gotten
slightly convoluted, clean it up so it's easier to read

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 07:31:04 -04:00
Donald Sharp
4fbeeabc2b pimd: Remove pim_addr_dump
This function is no longer used, remove it from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 07:29:26 -04:00
Donald Sharp
bbb83251c1 pimd: Convert usage of pim_addr_dump to %pFXh
pim_addr_dump would dump the group data as a v4 or v6 address
let's just convert to our internal printf handler.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21 07:29:26 -04:00
Donatas Abraitis
3a58764e3a
Merge pull request #14034 from LabNConsulting/aceelindem/ospf_prefix_suppression
ospfd: Implement OSPF prefix-suppression as specified in RFC 6860
2023-07-21 10:14:22 +03:00
Donald Sharp
4562750624
Merge pull request #14066 from opensourcerouting/fix/libyang_2.1.80
Switch to libyang 2.1.80
2023-07-20 23:08:28 -04:00
Donatas Abraitis
8456322835 docker: Use libyang 2.1.80 for Alpine builds
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 23:57:34 +03:00
Donatas Abraitis
27083f7885 docker: Move Alpine dependency packages to APKBUILD file
Do not mix APKBUILD and Dockerfile when installing dependencies.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 22:39:14 +03:00
Donatas Abraitis
3fed088e1b docker: Install protobuf-c-devel for ubi8-minimal
configure: error: in `/src':
configure: error: protobuf requested but protoc-c not found.  Install protobuf-c.
See `config.log' for more details

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 22:35:53 +03:00
Donatas Abraitis
1152259d8d docker: Use Alpine Linux 3.18
It has the newer libyang version 2.1.55, while 3.17 has 2.1.30.

3.19 will have 2.1.80.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 22:11:03 +03:00
Donatas Abraitis
237e2c62ed docker: Use libyang 2.1.80
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 22:10:19 +03:00
Acee
e2eea4fe8e ospfd: Implement OSPF prefix-suppression as specified in RFC 6860
Signed-off-by: Acee <aceelindem@gmail.com>
2023-07-20 14:56:43 -04:00
Donatas Abraitis
bce323f2f4 redhat: Require libyang 2.1.80
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 21:54:22 +03:00
Donatas Abraitis
62576d9238 debian: Require libyang 2.1.80
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 21:52:26 +03:00
Rafael Zalamena
01ec8c260a doc: remove BFD label command references
`label` command is already gone and now we are going to remove all label
references.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-07-20 15:49:07 -03:00
Donatas Abraitis
7f876ef5ed snapcraft: Use libyang 2.1.80
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-20 21:46:38 +03:00
G. Paul Ziemba
580a98b798 lib: zapi PBR common encode/decode
bgpd, pbrd: use common pbr encoder
    zebra: use common pbr decoder
    tests: pbr_topo1: check more filter fields

    Purpose:
	1. Reduce likelihood of zapi format mismatches when adding
	   PBR fields due to multiple parallel encoder implementations
	2. Encourage common PBR structure usage among various daemons
	3. Reduce coding errors via explicit per-field enable flags

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-20 08:10:45 -07:00
Donald Sharp
d8525635f3
Merge pull request #14003 from iqras23/coverity
bgpd: Fix coverity for EVPN
2023-07-20 10:16:46 -04:00
Donald Sharp
46b47720a2
Merge pull request #14006 from AbhishekNR/mld_core
pim6d: Fixing core while running MLD conformance test.
2023-07-20 08:23:28 -04:00
Donald Sharp
59742b4550
Merge pull request #13605 from anlancs/fix/pimd-promote-interface
pimd: Fix missing promotion for primary address
2023-07-20 08:16:17 -04:00
Donald Sharp
1b1d256f03
Merge pull request #14026 from LabNConsulting/pbr-add-vlan-filters
pbrd: 1/3: add vty support for vlan filtering and send to zebra
2023-07-20 08:01:24 -04:00
Donatas Abraitis
698d53bf58
Merge pull request #14055 from guoguojia2021/route_lock
zebra:unlock node after route_next
2023-07-20 10:06:47 +03:00
Donald Sharp
83f68fc31e
Merge pull request #14058 from kuldeepkash/pim_v6
tests: Update join state in verify_upstream_iif API
2023-07-19 15:45:09 -04:00
Donald Sharp
57bd4b5133
Merge pull request #14054 from zice312963205/zly_evpn
zebra:fix a zebra crash issue caused by mac change
2023-07-19 15:44:42 -04:00
G. Paul Ziemba
8b330fe8b7 pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (doc, tests)
Subset: doc and tests

    doc
	PBR section updated with new fields and some copy-editing

    tests
	pbr_topo1: ensure new vlan fields arrive at zebra

    Changes by:
	Josh Werner <joshuawerner@mitre.org>
	Eli Baum <ebaum@mitre.org>
	G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-19 08:15:45 -07:00
G. Paul Ziemba
657882c430 pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zebra dplane)
Subset: zebra dataplane

    Add new vlan filter fields. No kernel dataplane
    implementation yet (linux does not support).

    Changes by:
	Josh Werner <joshuawerner@mitre.org>
	Eli Baum <ebaum@mitre.org>
	G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-19 08:15:15 -07:00
G. Paul Ziemba
dbade07e0e pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zapi)
Subset: ZAPI changes to send the new data

    Also adds filter_bm field; currently for PBR_FILTER_PCP, but in the
    future to be used for all of the filter fields.

    Changes by:
	Josh Werner <joshuawerner@mitre.org>
	Eli Baum <ebaum@mitre.org>
	G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-19 08:14:49 -07:00
G. Paul Ziemba
bfd3e8e012 pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (pbr feature)
Subset: feature in PBR

    New PBR rule fields:

    match ip-protocol (was only tcp|udp, now any value in /etc/protocols)
    match pcp (0-7)
    match vlan (1-4094)
    match vlan (tagged|untagged|untagged-or-zero)

    Filter flags
	Add filter_bm (flags) field internally to indicate which
	filter fields should be considered active. Bit definitions
	as in lib/pbr.h.

	This commit uses only the PBR_FILTER_PCP bit, but other
	fields will be added in future commits. (Fixes bug related
	to determining set/not-set state of pcp filter)

	Shift vlan filter flags to lib/pbr.h

    Changes by:
	Josh Werner <joshuawerner@mitre.org>
	Eli Baum <ebaum@mitre.org>
	G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-19 08:14:09 -07:00
Donald Sharp
d4191478b0
Merge pull request #13629 from anlancs/fix/pimd-order-pimreg
pimd: Fix wrong creating order for pimreg
2023-07-19 10:34:05 -04:00
Jack.zhang
a53159c8db zebra:fix a zebra crash issue caused by mac change
When the MAC address of the neighbor changes, a possible crash issue may occur.

In the zebra_evpn_local_neigh_update function, the value of old_zmac (n->mac) will be updated to the new MAC address when the neighbor's MAC address changes.
The pointer to the memory that this pointer points to may be released in the zebra_evpn_local_neigh_deref_mac function. This will cause old_zmac to become a dangling pointer. Accessing this dangling pointer in the zebra_evpn_ip_inherit_dad_from_mac function below will cause the zebra process to crash.

Here is the backtrace:
(gdb) bt
0  0x00007fc12c5f1fbf in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007fc12d52e19c in core_handler (signo=11, siginfo=0x7ffda1fd1570, context=<optimized out>) at lib/sigevent.c:262
2  <signal handler called>
3  zebra_evpn_ip_inherit_dad_from_mac (zvrf=<optimized out>, old_zmac=0x5579ac3ca520, new_zmac=0x5579aba82f80, nbr=0x5579abd65ec0) at zebra/ze
4  0x00005579aa8dbf6d in zebra_evpn_local_neigh_update (zevpn=0x5579abb81440, ifp=ifp@entry=0x5579ab8a1640, ip=ip@entry=0x7ffda1fd1b40, macadd
   local_inactive=local_inactive@entry=253, dp_static=false) at zebra/zebra_evpn_neigh.c:1729
5  0x00005579aa9190a9 in zebra_vxlan_handle_kernel_neigh_update (ifp=ifp@entry=0x5579ab8a1640, link_if=link_if@entry=0x5579abd14f90, ip=ip@ent
   is_ext=is_ext@entry=false, is_router=<optimized out>, local_inactive=false, dp_static=false) at zebra/zebra_vxlan.c:3791
6  0x00005579aa8b3048 in netlink_ipneigh_change (h=0x7ffda1fd1d50, len=<optimized out>, ns_id=<optimized out>) at zebra/rt_netlink.c:3649
7  0x00005579aa8ac667 in netlink_parse_info (filter=filter@entry=0x5579aa8ab630 <netlink_information_fetch>, nl=nl@entry=0x5579ab5861e8, zns=z
   startup=startup@entry=0) at zebra/kernel_netlink.c:965
8  0x00005579aa8ac8c8 in kernel_read (thread=<optimized out>) at zebra/kernel_netlink.c:402
9  0x00007fc12d53e60b in thread_call (thread=thread@entry=0x7ffda1fd9fd0) at lib/thread.c:1834
10 0x00007fc12d4fba78 in frr_run (master=0x5579ab3a1740) at lib/libfrr.c:1155
11 0x00005579aa89c6e3 in main (argc=11, argv=0x7ffda1fda3c8) at zebra/main.c:485
(gdb) f 3
3  zebra_evpn_ip_inherit_dad_from_mac (zvrf=<optimized out>, old_zmac=0x5579ac3ca520, new_zmac=0x5579aba82f80, nbr=0x5579abd65ec0) at zebra/ze
1230	zebra/zebra_evpn_neigh.c: No such file or directory.
(gdb) p *old_zmac
Cannot access memory at address 0x5579ac3ca520
(gdb)

To fix this issue, the ZEBRA_MAC_DUPLICATE flag should be retrieved before old_zmac is released and used in the zebra_evpn_ip_inherit_dad_from_mac function.

Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
2023-07-19 22:03:54 +08:00
Kuldeep Kashyap
3066746f5f tests: Update join state in verify_upstream_iif API
When JoinState is not passed to API it is expected to
be in Joined state, there was a minor bug in API, where
it was printng JoinState as None, which is default value
in API. Updated value to print Joined when verification
fails.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-07-19 19:21:01 +05:30
Donatas Abraitis
5a69379e81
Merge pull request #13951 from fdumontet6WIND/as_path_exclude_reg
bgpd: add set as-path exclude acl-list command
2023-07-19 16:35:33 +03:00
Alexander Chernavin
b1f759133b ospfd: fix default-metric change if external LSAs already sent
Currently, when redistribution of routes was configured, external LSAs
were already advertised to peers, and then default-metric is changed,
external LSAs refresh will not occur. In other words, the peers will not
receive the refreshed external LSAs with the new metric.

With this fix, changing default-metric will cause external LSAs to be
refreshed and flooded.

There is a similar task to refresh external LSAs when NSSA settings are
changed. And there is a function that accomplishes it -
ospf_schedule_asbr_nssa_redist_update(). Since the function does the
general work of refreshing external LSAs and is not specific to NSSA
settings, the idea is to give it a more general name and call it when
default-metric changes in order to fix the problem.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-07-19 13:12:40 +00:00
Kantesh Mundaragi
725f61150e bgpd: Fix coverity for EVPN
Reported Warning:
Compare member by member to check object equality

RCA:
struct evpn_addr contains padding

Authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2023-07-19 05:49:44 -07:00
mobash-rasool
5856033777
Merge pull request #14049 from opensourcerouting/fix/initialize_some_bools
bgpd: Initialize bgp_nht_ifp_table_handle() bools
2023-07-19 17:11:24 +05:30
guozhongfeng
88ff576f86 zebra:unlock node after route_next
When route_next return node, it has lock the node. if return or break loop, should unlock node.
Signed-off-by: guozhongfeng <guozhongfeng.gzf@alibaba-inc.com>
2023-07-19 19:39:22 +08:00
Francois Dumontet
291d334595 tests: add one test to bgp_exclude_aspath_exclude.py
add support of  set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-07-19 10:58:15 +02:00
Francois Dumontet
832b5c30c0 doc: set as-path exclude as-path-access-list
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-07-19 10:58:00 +02:00
Francois Dumontet
4685db418e bgpd: add set as-path exclude acl-list command
A route-map applied on incoming BGP updates is not able
to exclude the unwanted as segments, based on an AS path
access-list.

The below configuration illustrates the case:

router bgp 65001

address-family ipv4 unicast
 neighbor 192.168.1.2 route-map rule_2 in
exit-address-family

bgp as-path access-list RULE permit ^65

route-map rule_2 permit 10
 set as-path exclude as-path-access-list RULE

```
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
```

After:

```
do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
    Paths: (1 available, best #1, table default)
      Advertised to non peer-group peers:
      192.168.10.65
      2 3 123
        192.168.10.65 from 192.168.10.65 (10.10.10.11)
          Origin IGP, metric 0, valid, external, best (First path
received)
```

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-07-19 10:57:48 +02:00
Donald Sharp
3031b32ba8
Merge pull request #14048 from LabNConsulting/chopps/staticd-stop-parsing
static: stop vtysh from sending VRF commands to staticd
2023-07-18 19:18:12 -04:00