Commit Graph

29152 Commits

Author SHA1 Message Date
Donald Sharp
0b96b8288a lib: Cleanup workqueue.h to have variable declarations
Cleanup workqueue.h to have variable declarations as per
our standard.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-08 11:38:22 -04:00
Donald Sharp
d1c276681f lib: Fixup workqueue.c to use proper thread.h semantics
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-08 11:38:22 -04:00
Donald Sharp
e0220703d1 pimd: pim_addr_cmp returns 0 for same not -1 or 1
The test for setting pimDesignatedRouterLocal was comparing
the result of pim_addr_cmp to non zero to say that the
pim_dr_addr and primary_address are the same.  This is
not correct in that pim_addr_cmp returns 0 for being the
same, so the correct test is !pim_addr_cmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-08 11:36:48 -04:00
Donald Sharp
71623b304e
Merge pull request #11356 from mobash-rasool/pim-rfc-conform
pimd: Handle receive of (*,G) register stop with src addr as 0
2022-06-08 08:15:58 -04:00
Sarita Patra
d8cace8772 pim6d: Introduced PIMREG macro
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-06-08 01:59:37 -07:00
Donatas Abraitis
8bf53b1594 debian: Update changelog for new release (8.4)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 23:26:58 +03:00
Donatas Abraitis
fb30d88928 redhat: Update changelog for new release (8.4)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 23:26:56 +03:00
Donatas Abraitis
ba9dce1c87 bgpd: Print source VRF name when leaking to another VRF
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 22:50:25 +03:00
Donatas Abraitis
3840a8193e bgpd: Withdraw implicitly old paths from VRFs when import/export list changes
If we overwrite import/export RT list via route-maps or even flush by using
`set extcommunity none`, then we must withdraw old paths from VRFs to avoid
stale paths.

For example using:

```
router bgp 65500 vrf vrf1
 bgp router-id 10.180.1.1
 !
 address-family ipv4 unicast
  network 192.168.100.100/32 route-map rm
  rd vpn export 65500:10001
  rt vpn import 65500:10000 65500:10990
  rt vpn export 65500:10000
  export vpn
  import vpn
 exit-address-family
exit
!
router bgp 65500 vrf vrf2
 bgp router-id 10.180.1.1
 !
 address-family ipv4 unicast
  rd vpn export 65500:11001
  rt vpn import 65500:11000 65500:11990
  rt vpn export 65500:11000
  export vpn
  import vpn
 exit-address-family
exit
!
route-map rm permit 10
 set extcommunity rt 65500:10100 65500:12990 65500:13990 65500:11990
exit
```

If we strip extcommunities using:

```
route-map rm permit 10
 set extcommunity none
exit
```

or

```
route-map rm permit 10
 set extcommunity rt 65500:10100 65500:12990 65500:13990
```

Routes that are imported with 65500:11990 (192.168.100.100/32 from vrf1)
becomes stale.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 22:50:24 +03:00
Donatas Abraitis
087350d968 build: FRR 8.4 development version
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 22:47:17 +03:00
Pushpasis Sarkar
aa800819cd
Merge pull request #11312 from opensourcerouting/feature/draft-ietf-idr-bfd-subcode
bgpd: Add Notification CEASE BFD Down message
2022-06-07 21:27:12 +05:30
Olivier Dugeon
96b706b72a
Merge pull request #11334 from ton31337/fix/deprecation_warning
ospfd: Remove local-block deprecated command
2022-06-07 17:38:52 +02:00
Pushpasis Sarkar
4d571bb3c4
Merge pull request #11158 from cyberstormdotmu/master
lib/md5,lib/sha256: Use explicit_bzero to clean up sensitive data.
2022-06-07 21:05:03 +05:30
Russ White
d7f2f10ed4
Merge pull request #11318 from pguibert6WIND/isis_mt_std
isisd: add ISIS_MT_STANDARD define
2022-06-07 11:30:05 -04:00
Donald Sharp
a775175bfd
Merge pull request #11289 from LabNConsulting/chopps/ospfapi-update
ospfapi improvements and fixes
2022-06-07 11:00:56 -04:00
Donatas Abraitis
d2e02cbf64 ospfd: Remove local-block deprecated command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 16:11:46 +03:00
Mobashshera Rasool
e502ecad11 pimd: Handle receive of (*,G) register stop with src addr as 0
PIM conformance test case 11.12 sends a register stop msg with
source address as 0. This should trigger a register stop for
all the upstreams. It is not happening as such because we are not
considering 0.0.0.0 source address for starg_handling.

Fixed it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-07 05:53:46 -07:00
Donatas Abraitis
0f05ea43b0 bgpd: Initialize attr->local_pref to the configured default value
When we use network/redistribute local_preference is configured inproperly
when using route-maps something like:

```
network 100.100.100.100/32 route-map rm1
network 100.100.100.200/32 route-map rm2

route-map rm1 permit 10
 set local-preference +10
route-map rm2 permit 10
 set local-preference -10
```

Before:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
10
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
0
```

After:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
110
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
90
```

Set local-preference as the default value configured per BGP instance, but
do not set LOCAL_PREF flag by default.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-06 10:28:50 +03:00
Christian Hopps
ad9c18f375 tests: add opaque api test
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
9191ac86fd ospfclient: add ospfclient api python class
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
bd1188f904 ospfd: api: always ready to receive opaque from client
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
97355a6d92 ospfd: api: add new ISM and NSM sync requests
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
b1e40ef0ea ospfd: api: remove unused api code/message creation
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
5349121b4c ospfd: api: fix recovery of LSA after restart of api client
Prior to this fix, restarting the client just failed b/c the code tried to
"refresh" the existing LSA being added, except that code checked for meta-data
to exist, which was deleted when the client disconnected previously (or had
never connected and the LSA state was picked up from the network).

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
d86760acad ospfd: cli: add "show ip ospf reachable-routers" CLI
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
149491af80 ospfd: api: add reachable router notifications
Reachable router information is used by OSPF opaque clients in order
to determine if the router advertising the opaque LSA data is
reachable (i.e., 2-way conectivity check).

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
b538baf352 ospfd: add all_rtrs route table when opaque enabled
The reachable router table is used by OSPF opaque clients in order to
determine if the router advertising the opaque LSA data is
reachable (i.e., 2-way conectivity check).

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Philippe Guibert
a15014f317 isisd: replace ipv4-unicast with standard in config and oper contexts
Only the multi-topology command can use 'ipv4-unicast' keyword to
configure standard topology.
The remaining code: dump from show commands, and yang definition,
uses 'standard' keyword instead.

The test have not been modified. The change would consists in
modifying test_fuzz_isis_tlv_tests.h.gz:
- replacing ipv4-unicast occurences with standard
\x69\x70\x76\x34\x2d\x75\x6e\x69\x63\x61\x73\x74
with
\x73\x74\x61\x6e\x64\x61\x72\x64

- align the buffer length by removing 4 bytes per occurence
Instead, a specific isis_mtid2str_fake() routing has been
put in place in isis_tlvs.c file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-06-02 21:20:45 +02:00
Jafar Al-Gharaibeh
23a1220847
Merge pull request #11175 from louis-6wind/ip-vrf-exec
topotests: fix "ip vrf exec"
2022-06-02 13:33:49 -05:00
Donald Sharp
84a5e31fd9
Merge pull request #11329 from opensourcerouting/ospf6-frag-rx
ospf6d: fix rx/tx buffer sizes
2022-06-02 09:11:56 -04:00
Donatas Abraitis
aebe2e379f bgpd: Add Notification CEASE BFD Down message
Related: https://datatracker.ietf.org/doc/html/draft-ietf-idr-bfd-subcode

When BFD Down notification comes and BGP is configured to track on BFD events,
send BGP Cease/BFD Down notification to the peer.

If RFC 8538 is enabled (Notification support for Graceful-Restart), notification
should be encapsulated into Hard Reset message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-02 16:06:57 +03:00
Donatas Abraitis
a49e87d2d4 bgpd: Fix memory leak when setting [l]community at egress
```
==2209758== 7,791,480 (399,840 direct, 7,391,640 indirect) bytes in 9,996 blocks are definitely lost in loss record 102 of 103
==2209758==    at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2209758==    by 0x4EE264F: qcalloc (memory.c:116)
==2209758==    by 0x22E62A: lcommunity_new (bgp_lcommunity.c:42)
==2209758==    by 0x22E62A: lcommunity_dup (bgp_lcommunity.c:155)
==2209758==    by 0x26F28F: route_set_lcommunity (bgp_routemap.c:2382)
==2209758==    by 0x4EFF7EF: route_map_apply_ext (routemap.c:2663)
==2209758==    by 0x250B3D: subgroup_announce_check (bgp_route.c:2202)
==2209758==    by 0x27A195: subgroup_announce_table (bgp_updgrp_adv.c:690)
==2209758==    by 0x27A509: subgroup_coalesce_timer (bgp_updgrp_adv.c:332)
==2209758==    by 0x4F1C3FC: thread_call (thread.c:2002)
==2209758==    by 0x4ED6D67: frr_run (libfrr.c:1196)
==2209758==    by 0x1E921B: main (bgp_main.c:519)
```

To reproduce it's enough to have something like applied at egress:

```
route-map test permit 10
 on-match goto 15
 set large-community 20717:0:0 20717:1:1820 20717:1:3303 20717:1:4788 20717:1:5416 20717:1:5713 20717:1:6774 20717:1:8309 20717:1:8529 20717:1:8697 20717:1:8966 20717:1:9038 20717:1:9119 20717:1:9304 20717:1:9498 20717:1:12779 20717:1:12883 20717:1:13113 20717:1:14340 20717:1:14907 20717:1:15802 20717:1:16347 20717:1:16637 20717:1:18403 20717:1:20717 20717:1:20928 20717:1:21245 20717:1:25818 20717:1:28917 20717:1:30844 20717:1:30990 20717:1:31133 20717:1:35297 20717:1:35320 20717:1:35432 20717:1:35819 20717:1:35838 20717:1:36994 20717:1:37100 20717:1:37558 20717:1:37662 20717:1:39180 20717:1:39405 20717:1:41095 20717:1:43996 20717:1:45489 20717:1:45903 20717:1:47794 20717:1:51185 20717:1:51254 20717:1:58715 20717:1:59605 20717:1:60427 20717:1:62955 20717:1:63008 20717:1:63927 20717:1:64049 20717:1:132602 20717:1:198435 20717:1:205988 20717:1:208278 20717:1:327700
exit
!
route-map test deny 15
exit
!
```

On the other side doing:
```
spine1-debian-11# sharp install routes 100.100.100.1 nexthop 192.168.10.65 30
spine1-debian-11# sharp remove routes 100.100.100.1 30
spine1-debian-11# sharp install routes 100.100.100.1 nexthop 192.168.10.65 30
```

Before:

```
Large Community               :       66     40        2816       66      2816
Large Community value         :       66 variable     29728       66     29728
Large Community               :       96     40        4096       96      4096
Large Community value         :       96 variable     52048       96     52048
```

After:
```
Large Community               :       28     40        1152       29      1192
Large Community value         :       28 variable      1456       29      2200
Large Community               :       28     40        1152       29      1192
Large Community value         :       28 variable      1456       29      2200
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-02 13:36:13 +03:00
Christian Hopps
a6c39c3d1a ospfd: cli: add client api debug option
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-01 18:11:31 -04:00
Jafar Al-Gharaibeh
1bf4e04e0e
Merge pull request #11314 from chiragshah6/fdev2
zebra: add error check condition to sock option
2022-06-01 12:45:49 -05:00
David Lamparter
c047b50638 ospf6d: fix rx/tx buffer sizes
OSPFv3 packets can be fragmented and up to 64k long, regardless of
interface MTU.  Trying to size these buffers to MTU is just plain wrong.
To not make this a super intrusive change during the 8.3 release freeze,
just code this into ospf6_iobuf_size().

Since the buffer is now always 64k, don't waste time zeroing the entire
thing in receive;  instead just zero kind of a "sled" of 128 bytes after
the buffer as a security precaution.

Fixes: #11298
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-06-01 17:10:11 +02:00
Donatas Abraitis
67f67ba481 bgpd: Drop label_ntop/label_pton functions
Start using mpls_lse_encode/mpls_lse_decode, that is endian-aware, because
we always use host-byte order, should use network-byte.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-01 16:45:22 +03:00
Philippe Guibert
6d07d1af11 isisd: add ISIS_MT_STANDARD define
This define is added to reflect more what the standard
topology means. Actually, the standard topology may
contain not only IPv4 protocol but also IPv6 protocol.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-06-01 15:27:32 +02:00
Donatas Abraitis
f5b2f86ac0
Merge pull request #11326 from gromit1811/fix_init_stop_msgs2
tools: Really fix all daemon shutdown without complaining about PID files
2022-06-01 15:26:52 +03:00
Martin Buck
c594796d0f tools: Really fix all daemon shutdown without complaining about PID files
Fix daemon shutdown broken by f0cccaa6bf. Now
we still don't complain about missing PID files but actually stop the
running daemons.

The previous fix was broken because it passed a new "--all" option to
daemon_stop which wasn't handled properly (it assumed $1 contains the
daemon name when at that time it acutally contained the "--all" option).
Plus, "--all" wasn't actually necessary, because we already passed
"--reallyall" from all_stop to daemon_stop after the daemon name.

So remove "--all" again and simply check for "--reallyall" in $2. This
should *really* fix #11317.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2022-06-01 11:58:52 +02:00
Donatas Abraitis
134890bf13
Merge pull request #11315 from gromit1811/fix_init_stop_msgs
tools: Don't complain about missing PID files when stopping all damons
2022-06-01 11:24:13 +03:00
Donatas Abraitis
c6c4b5e68f
Merge pull request #11319 from donaldsharp/retry
tests: Remove duplicated work
2022-06-01 08:08:55 +03:00
Donatas Abraitis
642af850fd
Merge pull request #11322 from donaldsharp/peer_group_route_map_match
bgpd: Add ability to match `match peer <PEERGROUPNAME>`
2022-06-01 08:08:05 +03:00
Chirag Shah
e5b1de8a11 zebra: add error check condition to sock option
Adding error checking condition which was missed
in PR-11216.

*** CID 1517953:  Error handling issues  (CHECKED_RETURN)
/zebra/kernel_netlink.c: 313 in netlink_socket()
307                     memset(&snl, 0, sizeof(snl));
308                     snl.nl_family = AF_NETLINK;
309                     snl.nl_groups = groups;
310
311     #if defined SOL_NETLINK
312                     if (ext_groups)
>>>     CID 1517953:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "setsockopt(sock, 270, 1, &ext_groups, 8U)" without checking return value. This library function may fail and return an error code.
313                             setsockopt(sock, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
314                                        &ext_groups, sizeof(ext_groups));
315     #endif
316
317                     /* Bind the socket to the netlink structure for anything. */
318                     ret = bind(sock, (struct sockaddr *)&snl, sizeof(snl));

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-05-31 13:50:48 -07:00
Donald Sharp
da49af8cda
Merge pull request #11293 from opensourcerouting/feature/update_workflow_dates
doc, tools: Update release dates in workflow.rst
2022-05-31 13:20:47 -04:00
Donald Sharp
1bb1c0cfc3 bgpd: Add ability to match match peer <PEERGROUPNAME>
Allow the end operator to match `match peer <PEERGROUPNAME>`
in a route-map.  If the end operator defines interface
based peers and peer-groups that have names that overlap
the interface based peer will match first.

Fixes: #11316
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-31 12:31:19 -04:00
Donatas Abraitis
8aa3ae6dbb
Merge pull request #11299 from taspelund/update-svi-macip
zebra: Update advertise-svi-ip MACIPs w/ new MAC
2022-05-31 17:53:46 +03:00
Loganaden Velvindron
04b4b595d3 lib/md5,lib/sha256: Use explicit_bzero to clean up sensitive data.
explicit_bzero() is available as an API to clean up sensitive data
and avoid compiler optimizations that remove calls to memset() or bzero().

Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
2022-05-31 18:00:18 +04:00
Donald Sharp
0a0533a9a6 tests: Remove duplicated work
If at first you succeed try try again.
No I mean if it works the first time no need to do
the same command again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-31 09:45:38 -04:00
Russ White
24738fbee8
Merge pull request #10997 from Orange-OpenSource/isis-sr
isisd: Stop fulfill MPLS table when SR is disabled
2022-05-31 08:27:56 -04:00
Martin Buck
f0cccaa6bf tools: Don't complain about missing PID files when stopping all damons
Since 1686b1d486, we try to stop all daemons,
even those which are not (no longer) enabled in /etc/frr/daemons. But we
shouldn't complain about missing PID files for daemons which have never been
started and just silently ignore those.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2022-05-31 14:16:34 +02:00