Donatas Abraitis [Thu, 17 Oct 2024 08:11:50 +0000 (11:11 +0300)]
bgpd: Handle non-transitive extended communities for link-bandwidth
If we received a non-transitive extended community (in this case it was
extended link-bandwidth), we treated it as unknown because we didn't check for
the transitive flag correctly.
baozhen-H3C [Mon, 21 Oct 2024 08:20:27 +0000 (16:20 +0800)]
isisd: fix 'show isis route' and 'show isis fast-reroute summary' errors with vrf
When the VRF does not exist, the command will display results for the 'default' VRF.
1.before the commit:
sonic# show vrf
vrf Vrf1 id 41 table 1001
sonic# show isis vrf abc route level-1
Area 10:
IS-IS L1 IPv4 routing table:
2.after the commit:
sonic# show vrf
vrf Vrf1 id 41 table 1001
sonic# show isis vrf abc route level-1
sonic# show isis vrf abc fast-reroute summary level-1
What I do:
Move 'ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);' to the front, otherwise changing 'idx' while searching for other parameters may result in failing to find the vrf parameter.
Enke Chen [Tue, 22 Oct 2024 01:03:08 +0000 (18:03 -0700)]
bgpd: fix AIGP calculation in route advertisement
Currently the AIGP is always incremented when a route with the
attribute is advertised. That is incorrect when the nexthop is
unchanged, as is commonly the case in route reflection.
Adjust the AIGP for propagation only when the nexthop is set
to ourselves.
Enke Chen [Tue, 22 Oct 2024 00:49:19 +0000 (17:49 -0700)]
tests: add a topotest bgp_aigp_rr
In this topotest, the route reflector advertises a route with the
aigp attribute to its client, some with the nexthop unchanged and
some with the nexthp changed. Different aigp values are sent to
the clients depending on the nexthop setting.
Enke Chen [Sun, 20 Oct 2024 19:25:46 +0000 (12:25 -0700)]
bgpd: allow value 0 in aigp-metric setting
The value of 0 is accepted from peers, and can also be set by the
route-map "set aigp-metric igp-metric". For coonsistency, it should
be allowed in "set aigp-metric <value>" as well.
Donald Sharp [Tue, 8 Oct 2024 01:46:33 +0000 (21:46 -0400)]
lib: Correctly handle ppoll pfds.events == 0
The frrevent system is spitting out this message in bgpd:
20:40:15 mem1-roc-f2-b1-r5-t2-d4 bgpd[13166]: [XETTR-D5MR0][EC 100663316] Attempting to process an I/O event but for fd: 214(8) no thread to handle this!
This is because as each io event is processed, it is possible that a
.events is set to 0. This can leave a situation where we ask
ppoll to handle anything that happens on a fd with a .events of 0,
in this situation ppoll can return POLLERR, which indicates that
something bad has happened on the fd.
Let's set the ppoll fds.fd value to -1 when there are no more
events to be processed. ppoll specifically calls out that
it will just skip this particular one.
Shbinging [Wed, 16 Oct 2024 05:28:02 +0000 (05:28 +0000)]
ospfd: update ospf_asbr_status when using no_area_nssa command
In the processing of nssa, if the number of areas that need to be translated is greater than 0, then abr will be regarded as asbr, and it will be marked (0x3) in the flag of router lsa. When a certain area is set from nssa to a normal area, the areas that need to be translated may be reduced. The asbr should be re-interpreted as abr when the translated area is 0.
Enke Chen [Wed, 16 Oct 2024 18:15:28 +0000 (11:15 -0700)]
bgpd: fix several issues in sourcing AIGP attribute
Fix several issues in sourcing AIGP attribute:
1) AIGP should not be set as default for a redistributed route or a
static network. It should be set by config instead.
2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
not set the correct value for a redistributed route.
3) When redistribute a connected route like loopback, the AGIP (with
value 0) is sourced by "set aigp-metric igp-metric", but the
attribute is not propagated as the attribute flag is not set.
David Lamparter [Wed, 16 Oct 2024 10:50:50 +0000 (12:50 +0200)]
vtysh: make clang-SA happy about reusing stdin
While the logic here is perfectly fine, clang-SA doesn't understand that
the fopen() and fclose() match up with each other. Just use a separate
variable to make clang-SA happy.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:46:35 +0000 (12:46 +0200)]
vtysh: remove duplicate nonblocking handling
non-blocking retries are already handled in `vtysh_client_receive()`.
And by the point we're back in `vtysh_client_run()`, errno may have been
overwritten by the close() call in vtysh_client_receive().
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:40:01 +0000 (12:40 +0200)]
ldpd: free previous config if it wasn't applied
If a create-config command is received, but the config is never applied,
the config will be leaked on the next create-config command. This
should theoretically never happen, but let's fix it anyway.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:45:35 +0000 (12:45 +0200)]
pimd: mark rest-of-packet ignored in C-RP parse
The `buf` pointer is being updated as the parse goes along. It's not
used after the last update, but I'd rather keep this in for consistency.
Just make a note of it being unused.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:43:52 +0000 (12:43 +0200)]
pimd: initialize prefix value in Auto-RP
clang-SA complains that it's only partially initialized (because it's
used with IPv4 only). The code later calls some AF-generic code,
prompting clang-SA to complain that the non-IPv4 parts are used without
being set. While this shouldn't happen, just initialize it fully.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:42:30 +0000 (12:42 +0200)]
lib: fix invalid use of errno in PTM
errno is only valid if there was an actual error. A zero return value
isn't an error, it's either EOF or an empty datagram depending on
context. Fix the logic.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:41:06 +0000 (12:41 +0200)]
lib: make clang-SA not choke on defun_lex.l
The flex-generated code is disabled for clang-SA builds already, but
that means that function prototypes are missing too. Just add dummy
function prototypes so clang-SA can process the file.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:24:44 +0000 (12:24 +0200)]
*: clang-SA switch-enum initializer workarounds
In these cases the value assigned by the switch block is used directly
rather than returned. Mark the initial/default value as used so
clang-SA doesn't complain about it.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 16 Oct 2024 10:23:23 +0000 (12:23 +0200)]
*: clang-SA friendly switch-enum-return-string
clang-19's SA complains about unused initializers for this kind of
"switch (enum) { return string }" kind of code. Use direct string
return values to avoid the issue.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Wed, 20 Mar 2024 19:32:30 +0000 (15:32 -0400)]
zebra: Attempt to explain the rnh tracking code better
I got asked today what was going on in the rnh code. I
had to take time off of what I was doing and rewrap my
head around this code, since it's been a long time.
As that this question may come up again in the future
I am trying to document this better so that someone
coming behind us will be able to read this and get
a better idea of what the algorithm is attempting
to do.
Donald Sharp [Fri, 11 Oct 2024 18:01:10 +0000 (14:01 -0400)]
*: Fix up improper handling of nexthops for nexthop tracking
Currently FRR needs to send a uint16_t value for the number
of nexthops as well it needs the ability to properly decode
all of this. Find and handle all the places that this happens.
bgpd: Re-announce the routes if the underlay IGP metric changes
If the underlay IGP metric changes, we SHOULD re-announce the routes with the
correct bpi->extra->igpmetric set.
Without this patch if the IGP link cost (metric) changes, we never notice this
and the peers do not have the updated metrics, which in turn causes incorrect
best path selections on remote peers.
David Lamparter [Tue, 15 Oct 2024 11:28:41 +0000 (13:28 +0200)]
tools/gcc-plugins: don't crash on array parameters
Need to have arrays as a stop condition in this type normalization
function, like pointers and function pointers. Actual arrays as
argument types are extremely rare to see because C has this
array-decay-to-pointer thing, but it can happen.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Shbinging [Tue, 15 Oct 2024 07:26:50 +0000 (07:26 +0000)]
ospfd:fix the bug that the empty area was not free after the command was executed
When we use the no area X.X.X.X range A.B.C.D/M command, if the area no longer has an interface to which it belongs, then the area should be deleted from the LSDB. This processing logic is consistent with instructions such as no network area and no area authentication.