zebra: Refactor seg6 encoding into common helper functionThe logic for encoding SRv6 seg6 info is
duplicated across two different code paths: the single-path route
builder (`_netlink_route_build_singlepath`) and the nexthop message
encoder (`netlink_nexthop_msg_encode`).
This commit extracts the common logic into a new static helper
function and refactors original functions to use this new helper.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
zebra: Refactor seg6local encoding into common helper functionThe logic for encoding SRv6 seg6local info is
duplicated across two different code paths: the single-path route
builder (`_netlink_route_build_singlepath`) and the nexthop message
encoder (`netlink_nexthop_msg_encode`).
This commit extracts the common logic into a new static helper
function and refactors original functions to use this new helper.
Signed-off-by: Carmine Scarpitta <cscarpit@cis...
zebra: Explicitly list all seg6local action cases in switch statementThe switch statement for handling seg6local actions in
`netlink_nexthop_msg_encode` uses a `default` case to catch all
unsupported actions.
This commit replaces the `default` with explicit `case` statements
for each unsupported action. This is a safer pattern that ensures
the compiler will generate a warning if a new enum member is added
without being explicitly handled.
Signed-off-by: Carmin...
zebra: Handle End.B6.Encaps behavior in single-path route encodingThe ZEBRA_SEG6_LOCAL_ACTION_END_B6_ENCAP action is handled
in the nexthop encoding path (`netlink_nexthop_msg_encode`), but it
is missing from the single-path route encoding path
(`_netlink_route_build_singlepath`).
As a result, the installation of a seg6local route with the
End.B6.Encaps behavior fails when kernel nexthop objects are not
used.
This commit extends the rt_netlink code to handl...
zebra: Generalize signature of End.B6.Encaps encoding helperChange the parameter of `netlink_nexthop_msg_encode_end_b6_encaps`
from `struct buf_req *` to `struct nlmsghdr *`.
This change is required to enable the function to be called from
`_netlink_route_build_singlepath` in a subsequent commit.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
zebra: Use zebra enums for seg6local actionsThe switch statement for seg6local actions in the netlink encoding path
switches on a variable of type `seg6local_action_t`, a Zebra-internal
enum. However, the `case` labels are using constants from the Linux
kernel header (`SEG6_LOCAL_ACTION_*`).
This only works because the values of the Zebra enum and the kernel
enum are currently identical. This is conceptually incorrect and would
lead to ...
bgpd: Use bgp_attr_[exists/set/unset] helpers when doing attr stuffThis would help in the future to avoid passing bare int (constant) instead
of using ATTR_FLAG_BIT() macro.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
zebra: Return checks are missing in some spotscoverity is pointing out that in most instances FRR is doing
return checks. Looks like just some new stuff that has come up
due to other checks going in place.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: fix BGP_ATTR_LOCAL_PREF being set appropriatelyThe BGP_ATTR_XXX flags are all using ATTR_FLAG_BIT to
find the right spot in the bitfield of the flags
variable. From looking at 004f9909c866ddf8d04e680db00120071dd22344
I decided to go looking at the rest of them. This
is where I found it wrong too.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: fix BGP_ATTR_ORIGINATOR_ID flag in outbound attribute cacheFix the setting of the BGP_ATTR_ORIGINATOR_ID flag in the outbound
attribute cache.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
ldpd: fix missing the pw messageEven if the remote didn't have any pw configuration, the local with pw
configuration still send a pw message after the nbr relation is established.
The pw configuration was set by remote later, but the local didn't send it again.
So let the local send explicitly this kind of pw message to remote.
Signed-off-by: anlan_cs <anlan_cs@126.com>
bgpd: use connection in bgp_open.c and bgp_packet.cFinish converting over bgp_open.c to using a struct peer_connection
for handling the connection.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: bgp_open internally should use a connection.Another connection oriented activity but we are sending
the peer instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: When creating a peer_connection pass in the sockunion for itWe have code that is creating a new peer_connection and then at
a later pointer it is setting those values. This is not correct.
It should just be passed in and worked from there.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: fix expanded extcomm list deletethis fix is related to extended communitylist deletion with
expanded regex rule.
current behavior:
if a value match the regex, all the extended community is deletedd.
expected behavior:
only values that match ethe regex are removed
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
pimd: demote a warning to a debug to avoid spamming the logsIf a router/switch keeps sending us a general igmp query with
a flag we don't expect, we shouldn't spam the logs, especially
if the condition is totally harmless and can be just ignored.
Just move it under a debug config.
Sample log firing every 15 seconds:
```
02:10:32 pimd: General IGMP query v3 from 192.168.1.1 on eth0: Suppress Router-Side Processing flag is clear
02:10:47 pimd: General I...
bgpd: Check L3VNI status before adv evpn vrf routesCheck L3VNI is UP before advertising any evpn vrf/Tye-5 routes.
There can be a timing EVPN type-5 default route is advertised
with VNI 0 and invalid RTs where l3vni is not known to bgpd.
The check ensures all type-5 route advertisement check for
L3VNI UP state.
Ticket:#2886476
Testing:
Validating via flapping vrf interface,
disable/enable advetise-pip in presence of advetise default
route as ...
bgpd: fix routemap evpn type-5 default route checkroute-map match condition on evpn default-route
does not have proper check that its truly type-5
before checking prefixlen being 0.
In absence of the fix, the set condition applied
to all evpn routes as evpn prefix is type union
so just checking for prefixlen 0 is not sufficient.
Ticket:#3227895
Issue:3227895
Testing Done:
Apply ingress route-map policy:
route-map POLICY_OUT_SS permit 10
...
tests: Convert bfd_isis_topo1 and bfd_ospf_topo1 to unified configStart the conversion of some tests to using a unified config for bfd.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Allow bfdd to be part of the unified config worldThe unified config loader was not properly handling bfdd.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>