After the munet switch we weren't passing the logger on to low-level
LinuxNamespace and thus Commander parent classes, so the lowest-level
`cmd_status` logs were missing from more specific log files in the run
directory.
Signed-off-by: Christian Hopps <chopps@labn.net>
- Remove the .pid and .vty files and then wait for them to show back up.
- Fix broken BGP GR test to not fail now that it's bug is exposed. It
only worked b/c when starting a daemon the pid file still existed and
blocked the bogus second BGP launch from happening.
Signed-off-by: Christian Hopps <chopps@labn.net>
Rather than create a new global dict and copy all the config into it, just
expose the pytest config globally and use it directly.
Signed-off-by: Christian Hopps <chopps@labn.net>
When using ls_stream2ted() function to parse Opaque Link State message to local
TED, in case of vertex or subnet deletion, the function return a pointer to the
deleted ls_element instead of NULL. This could lead into a potential pointer
corruption when caller try to access to the deleted ls_element.
This patch ensure that the ls_element pointer return by ls_stream2ted()
function is NULL when the message event is a delete operation for vertex and
subnet. Note that edge deletion was correctly handled.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
In function ls_find_subnet(), prefix argument is directly copied into
subnet.key structure to find corresponding subnet in RB Tree. This could leadr
to a memory corruption. Function prefix_copy() must be used instead.
This patch replaces the direct prefix copy by a call to prefix_copy() function
to avoid this memory issue.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.
Test case added to tests/lib/test_typelist.
Note this function is not currently used anywhere. Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Looking at the coverity report, it complains that tabshift could be
zero, resulting in a uint32_t shifted by 33 (which is undefined.)
As I was confused by the "+ 1", in addition to the SA assume(), leave
some breadcumbs for next time this comes up.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Coverity complains about these being tainted/untrusted loop boundaries.
The way the code works, it's counting up groups/sources, but keeps
checking against remaining data length in the packet - which is
perfectly fine IMHO. Except Coverity doesn't understand it :(
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The error condition handled both failure to open
and a fstat failure. Just double check that the close
is appropriate to call.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Remove the pointer check for ctx. At this point in the
function it has to be non null since we deref'ed it.
Additionally the alloc function that creates it cannot
fail.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Coverity has incorrectly found that a switch statement
can be fallen through. It is missing the fact that the
previous case statement has a return through every path
it can get too. Let's just appease coverity
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Coverity points out that rd_str has already been
deref'ed in all paths leading to this spot. No
need to keep at it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Coverity shows a path where the pim instance may
be null. In this code path if we have no pim
vrf there is nothing to do anyway so just return
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The current local mac delete event send to flag with force
always which breaks the duplicate detected MACs where
it requires to be resynced from bgpd to earlier state.
Ticket:#3233019
Issue:3233019
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Upon receiving local mobility event for MAC + NEIGH,
both are detected as duplicate upon hitting DAD threshold.
Duplicated detected ( freezed) MAC + NEIGH are not known
to bgpd.
If locally learnt MAC + NEIGH are deleted in kernel,
the MAC is marked as AUTO after sending delete event
to bgpd.
Bgpd only reinstalls best route for MAC_IP route (NEIGH)
but not for MAC event.
This puts a situation where MAC is AUTO state and
associated neigh as remote.
Fix:
DUPLICATE + LOCAL MAC deletion, set MAC delete request
as reinstall from bgpd.
Ticket:#2873307
Reviewed By:
Testing Done:
Freeze MAC + two NEIGHs in local mobility event.
Delete MAC and NEIGH from kerenl.
bgp rsync remote mac route which puts MAC to remote state.
Signed-off-by: Chirag Shah <chirag@nvidia.com>
If you have a very large number of large communities whose
string length happened to be greater than BUFSIZ FRR's bgpd
would crash. This is because bgpd would write beyond
the end of the string.
Originally the code auto-calculated the string size appropriately
but commit ed0e57e3f0 modified
the string length to be a hard coded BUFSIZ. When a route-map
like this is added:
route-map LARGE-OUT permit 10
set large-community 4635:0:0 4635:1:906 4635:1:2906 4635:1:4515 4635:1:4594 4635:1:4641 4635:1:4760 4635:1:7979 4635:1:9253 4635:1:9293 4635:1:9304 4635:1:9908 4635:1:13335 4635:1:16265 4635:1:17924 4635:1:18013 4635:1:20940 4635:1:22822 4635:1:24429 4635:1:24482 4635:1:32590 4635:1:32934 4635:1:36692 4635:1:38008 4635:1:38819 4635:1:41378 4635:1:45753 4635:1:46489 4635:1:49544 4635:1:51847 4635:1:54574 4635:1:54994 4635:1:55720 4635:1:56059 4635:1:57724 4635:1:65021 4635:1:134823 4635:1:136907 4635:1:146961 24115:0:24115 24115:1:906 24115:1:2906 24115:1:4515 24115:1:4594 24115:1:4641 24115:1:4760 24115:1:7979 24115:1:9253 24115:1:9293 24115:1:9304 24115:1:9908 24115:1:13335 24115:1:16265 24115:1:17924 24115:1:18013 24115:1:20940 24115:1:22822 24115:1:24429 24115:1:24482 24115:1:32590 24115:1:32934 24115:1:36692 24115:1:38008 24115:1:38819 24115:1:41378 24115:1:45753 24115:1:46489 24115:1:49544 24115:1:51847 24115:1:54574 24115:1:54994 24115:1:55720 24115:1:56059 24115:1:57724 24115:1:65021 24115:1:134823 24115:1:136907 24115:1:100000 24115:1:100001 24115:1:100002
exit
BGP would have issues and crash.
Modify the code to correctly determine the string length of the communities
and to also double check if the string has an alias and ensure that the
string is still sufficiently large enough. If not auto size it again.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
"show isis route algorithm ALGO json" display some text output before
printing the JSON one.
Do not print the text output in JSON mode.
Fixes: 0833c25180 ("isisd: add an algorithm argument to show isis route")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Reported by coverity scanner #1560315
Do not attempt to update the affinity map if the main isis struct is not
yet created.
Fixes: 9a65cf35da ("isisd: add affinity-map configuration hooks")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Reported by coverity scanner #1560313
Do not consider the affinity map is in use if the main isis struct is
not yet created.
Fixes: 9a65cf35da ("isisd: add affinity-map configuration hooks")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Coverity scanner reported the overrun issue #1560312 because
reach->id length is 7 bytes and we are trying to copy 8 bytes
(ie. ISIS_SYS_ID_LEN + 2).
Fix the issue by using the %pPN to display directly the 7 bytes
system-id.
Fixes: 860b75b40e ("isisd: calculate flex-algo constraint spf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Let users know about the RIP BFD integration commands and increment the
used RFCs reference.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Add new RIP topology to test the BFD integration and RIP ECMP:
shutdown a link and expect the RIP route change immediately instead of
regular RIP timer.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
1. Consider a established L2VPN EVPN BGP peer with soft-reconfiguartion
inbound configured
2. When the interface of this directly connected BGP peer is shutdown,
bgp_soft_reconfig_table_update() is called, which memsets the evpn buffer
and calls bgp_update() with received attributes stored in ain table(ain->attr).
In bgp_update(), evpn_overlay attribute in ain->attr (which is an interned
attr) was modified by doing a memcpy
3. Above action causes 2 attributes in the attrhash (which were previously different)
to match!
4. Later during fsm change event of the peer, bgp_adj_in_remove() is called
to clean up the ain->attr. But, because 2 attrs in attrhash match, it causes
BGP to assert in bgp_attr_unintern()
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Before:
```
Routing Protocol is "rip"
Sending updates every 5 seconds with +/-50%, next due in 0 seconds
Timeout after 15 seconds, garbage collect after 10 seconds
Outgoing update filter list for all interface is not set
Incoming update filter list for all interface is not set
Default redistribution metric is 1
Redistributing:
Default version control: send version 2, receive any version
Interface Send Recv Key-chain
r1-eth0 2 1 2
Routing for Networks:
192.168.1.0/24
Routing Information Sources:
Gateway BadPackets BadRoutes Distance Last Update
192.168.1.2 0 0 120 00:00:05
192.168.1.3 0 0 120 00:00:04
Distance: (default is 120)
```
After:
```
Routing Protocol is "rip"
Sending updates every 5 seconds with +/-50%, next due in 4 seconds
Timeout after 15 seconds, garbage collect after 10 seconds
Outgoing update filter list for all interface is not set
Incoming update filter list for all interface is not set
Default redistribution metric is 1
Redistributing:
Default version control: send version 2, receive any version
Interface Send Recv Key-chain
r1-eth0 2 1 2
Routing for Networks:
192.168.1.0/24
Routing Information Sources:
Gateway BadPackets BadRoutes Distance Last Update
192.168.1.2 0 0 120 00:00:00
192.168.1.3 0 0 120 00:00:04
Distance: (default is 120)
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Without this patch, it's never get non-passive and even listed under status:
Configuration:
```
router rip
network 192.168.1.0/24
network 10.10.10.1/32
passive-interface default
no passive-interface r2-eth0
timers basic 5 15 10
exit
```
```
r2# do sh ip rip status
Routing Protocol is "rip"
Sending updates every 5 seconds with +/-50%, next due in 4 seconds
Timeout after 15 seconds, garbage collect after 10 seconds
Outgoing update filter list for all interface is not set
Incoming update filter list for all interface is not set
Default redistribution metric is 1
Redistributing:
Default version control: send version 2, receive any version
Interface Send Recv Key-chain
lo 2 1 2
r2-eth0 2 1 2
Routing for Networks:
10.10.10.1/32
192.168.1.0/24
Passive Interface(s):
lo
r2-eth0
Routing Information Sources:
Gateway BadPackets BadRoutes Distance Last Update
192.168.1.3 0 0 120 00:00:04
Distance: (default is 120)
r2#
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Debugging-isis tag was moved.
Move it to right place.
Fixes: 9389175b75 ("doc: add documentation for IS-IS Segment Routing")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>