tools: Do not wrap the pidfile into double-quotes for frrcommon.sh
The problem is that when we run watchfrr.sh/frrinit.sh, we get something like:
```
cat: '"/var/run/frr/staticd.pid"': No such file or directory
cat: '"/var/run/frr/babeld.pid"': No such file or directory
cat: '"/var/run/frr/zebra.pid"': No such file or directory
```
bgpd: Free ->raw_data from Hard Notification message after we use it
==175785== 0 bytes in 1 blocks are definitely lost in loss record 1 of 88
==175785== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==175785== by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==175785== by 0x269823: bgp_notify_decapsulate_hard_reset (in /usr/lib/frr/bgpd)
==175785== by 0x26C85D: bgp_notify_receive (in /usr/lib/frr/bgpd)
==175785== by 0x26E94E: bgp_process_packet (in /usr/lib/frr/bgpd)
==175785== by 0x4985349: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==175785== by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==175785== by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==175785==
pimd: Correct the order of show json for interface traffic
"show ip pim interface traffic json" shows pruneTx first and then
pruneRx stats
where as
"show ip pim interface <ifname> json" shows pruneRx first and then
pruneTx stats.
Although the values are right but the display looks odd.
Making it same as other stats, first display Rx and then Tx.
David Lamparter [Fri, 8 Jul 2022 11:59:10 +0000 (13:59 +0200)]
bgpd: work around GCC/plugin shortcomings
The GCC extended printf format checking plugin runs into some GCC
shortcomings regarding casts on printf function parameters. While this
can be fixed with a small GCC patch, patching GCC is "nontrivial" to say
the least. Luckily, it happens that this is /almost/ not an issue for
the FRR source base.
Since we fix SA "misunderstandings" too, let's just fix places where the
format checking plugin runs into this limitation to keep things working
extra smoothly.
(It's not a huge effort either, these two spots in bgpd are the only
places that trigger the plugin limitation, and it's been "clean" before
that for more than a year if my memory is right.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
redhat: Always disable PIM6d on CentOS 6 and RedHat 6 systems
Since these systems are too old to correctly support the protocol
disabling the PIM6d.
Also by default disable on all. Use --enable-pim6d flag to
enable it.
David Lamparter [Wed, 6 Jul 2022 09:26:01 +0000 (11:26 +0200)]
zebra: fix remaining MR RTM_GETROUTE oddities
The IPv6 version needs rtm_src_len and rtm_dst_len filled in due to
strict validation. IPv4 also has this requirement, but zebra is running
in non-strict mode there so the kernel accepts it...
Also the table ID hack is IPv4 only.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
When there is change in route-map policy associated with default-originate, changes does not reflect.
When route-map associated with default-originate is deleted, default route doesn't get withdrawn
Update message is not being sent when only route-map is removed from the default-originate config.
SNT counter gets incremented on change of every policy associated with default-originate
Route-map with multiple match clauses causes inconsistencies with default-originate.
Default-originate behaviour on BGP-attributes
Iqra Siddiqui [Fri, 27 May 2022 15:07:36 +0000 (08:07 -0700)]
bgpd: Fix insonsistencies with default-originate route-map
Description:
- When there are multiple policies configured with
route-map then the first matching policy is not
getting applied on default route originated with
default-originate.
- In BGP we first run through the BGP RIB and then
pass it to the route-map to find if its permit or
deny. Due to this behaviour the first route in
BGP RIB that passes the route-map will be applied.
Fix:
- Passing extra parameter to routemap_apply so that
we can get the preference of the matching policy,
keep comparing it with the old preference and finally
consider the policy with less preference.
Rafael Zalamena [Wed, 6 Jul 2022 10:52:17 +0000 (07:52 -0300)]
bfdd: fix coverity memory overrun
Use the destination for the operator `sizeof()` instead of the source
which could (and is) be bigger than destination.
We are not truncating any data here it just happens that the zebra
interface data structure hardware address can be bigger due to different
types of interface.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
David Lamparter [Wed, 6 Jul 2022 09:23:40 +0000 (11:23 +0200)]
zebra: IIF/OIF are not used in MR RTM_GETROUTE
The multicast routing RTM_GETROUTE command does not use IIF/OIF
attributes, and the IPv6 version will refuse them with an error due to
being new netlink API and thus using strict validation.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 6 Jul 2022 09:19:05 +0000 (11:19 +0200)]
zebra: correctly ignore multicast nl msgs
zebra does not care about _notifications_ from the kernel regarding
multicast routing; we only use the MR netlink API to request stats from
the kernel by actively sending a RTM_GETROUTE.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 6 Jul 2022 08:48:56 +0000 (10:48 +0200)]
lib: use assume() for SA fixing, add explainer
Literally 4 minutes after hitting merge on Mark's previous fix for this
I remembered we have an `assume()` macro in compiler.h which seems like
the right tool for this.
(... and if I'm touching it, I might as well add a little text
explaining what's going on here.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Iqra Siddiqui [Tue, 8 Mar 2022 07:53:07 +0000 (23:53 -0800)]
bgpd: Update msg not being sent on removing route-map from default-originate config
Description:
- On removing just the route-map from the default-originate config,
update message is not sent to the peer,
and the properties set by route-map persists on peer's end,
until we do a clear bgp.
Fix:
- The flag which is set when default route is originated,
should be unset once "neighbor X.X.X.X default-orginate",
to remove route-map from "neighbor X.X.X.X default-orginate route-map Y",
so as to trigger the flow for sending an update.
Abhinay Ramesh [Mon, 7 Mar 2022 08:56:10 +0000 (08:56 +0000)]
bgpd: fix route-map update and delete route-map
Description:
- When there is change in route-map properties after
setting the route-map with default route, changes
will not reflect.
- When route-map associated with default-originate is
deleted, default route doesn't get withdrawn.
- When there is change in route-map default-originate flow
does not get triggered.
Fix:
- One of the flags needs to be unset for default-originate
flow to get triggered after change in route-map.
Have unset the flag, so that default originate flow can
be triggered.
Iqra Siddiqui [Thu, 26 May 2022 06:45:57 +0000 (23:45 -0700)]
bgpd: Inconsistencies in SNT counters with default-originate
Description:
Change is intended for fixing the inconsistencies present
while adjusting the SNT counters with default originate.
- SNT counter gets incremented on every change of policy associated
with default-originate, leading to inconsistencies.
- This fix has been added to ensure that the SNT counters gets
incremented and decremented only once during the creation and
deletion workflow of default-originate, and prevents
incrementing the counter during update flow.