]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoMerge pull request #10775 from opensourcerouting/pim6-mld-pr
Donald Sharp [Tue, 17 May 2022 11:20:08 +0000 (07:20 -0400)]
Merge pull request #10775 from opensourcerouting/pim6-mld-pr

pim6d: MLD code

2 years agoMerge pull request #11152 from donaldsharp/dscp
Donatas Abraitis [Mon, 16 May 2022 19:53:41 +0000 (22:53 +0300)]
Merge pull request #11152 from donaldsharp/dscp

bgpd: Allow bgp to control the DSCP session TOS value

2 years agoMerge pull request #11207 from anlancs/fix/zebra-remove-check-l3vni
Donald Sharp [Mon, 16 May 2022 12:02:58 +0000 (08:02 -0400)]
Merge pull request #11207 from anlancs/fix/zebra-remove-check-l3vni

zebra: remove unncecessary check for l3vni

2 years agoMerge pull request #11199 from donaldsharp/nexthop_dump
Rafael Zalamena [Mon, 16 May 2022 11:09:54 +0000 (08:09 -0300)]
Merge pull request #11199 from donaldsharp/nexthop_dump

zebra: Add encap and group type decoding to nexthop dump

2 years agozebra: remove unncecessary check for l3vni
anlan_cs [Thu, 12 May 2022 01:29:10 +0000 (21:29 -0400)]
zebra: remove unncecessary check for l3vni

Since `l3vni` created by `zl3vni_add()` is always valid, remove the check
for it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11201 from donaldsharp/unused_in_netlink_compiles
Donatas Abraitis [Mon, 16 May 2022 06:57:30 +0000 (09:57 +0300)]
Merge pull request #11201 from donaldsharp/unused_in_netlink_compiles

Remove some unused functions in zebra

2 years agoMerge pull request #11180 from fdumontet6WIND/flag_pre_post
Donatas Abraitis [Sat, 14 May 2022 18:16:19 +0000 (21:16 +0300)]
Merge pull request #11180 from fdumontet6WIND/flag_pre_post

BMP fix invalid bmp POST POLICY flag

2 years agoMerge pull request #11135 from donaldsharp/bgp_rpki_no_forms
Donatas Abraitis [Sat, 14 May 2022 18:15:54 +0000 (21:15 +0300)]
Merge pull request #11135 from donaldsharp/bgp_rpki_no_forms

bgpd: Fix no form of rpki commands to take values

2 years agoMerge pull request #11149 from donaldsharp/update_group_debugging
Donatas Abraitis [Sat, 14 May 2022 18:15:03 +0000 (21:15 +0300)]
Merge pull request #11149 from donaldsharp/update_group_debugging

Update group debugging

2 years agoMerge pull request #11202 from anlancs/fix/check_zebra_vrf_get_evpn
Donald Sharp [Sat, 14 May 2022 13:53:42 +0000 (09:53 -0400)]
Merge pull request #11202 from anlancs/fix/check_zebra_vrf_get_evpn

zebra: remove unnecessary check for "zevpn_vrf"

2 years agozebra: remove unnecessary check for "zevpn_vrf"
anlan_cs [Sat, 14 May 2022 01:02:11 +0000 (21:02 -0400)]
zebra: remove unnecessary check for "zevpn_vrf"

The global vrf in zebra is always non-NULL. In general, it is bound to
default vrf by `zebra_vrf_init()`, at other times bound to some specific
vrf. Anyway, non-NULL.

So remove all redundant checkings for the returned value of
`zebra_vrf_get_evpn()`.

Additionally, remove the unnecessary check for `zvrf` in
`zebra_vxlan_cleanup_tables()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agozebra: Remove unused function `route_entry_copy_nexthops`
Donald Sharp [Fri, 13 May 2022 20:11:09 +0000 (16:11 -0400)]
zebra: Remove unused function `route_entry_copy_nexthops`

This function is no longer used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Remove unused functions in netlink compiles
Donald Sharp [Fri, 13 May 2022 19:58:33 +0000 (15:58 -0400)]
zebra: Remove unused functions in netlink compiles

When compiling with netlink,  Remove the usage of these
functions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Allow bgp to control the DSCP session TOS value
Pavel Shirshov [Thu, 5 May 2022 18:16:27 +0000 (14:16 -0400)]
bgpd: Allow bgp to control the DSCP session TOS value

Allow BGP to control the TOS DSCP value in the tcp header
via a new command at the bgp global level `bgp session-dscp <0-63>`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Pavel Shirhov <pavelsh@microsoft.com>
2 years agoMerge pull request #11198 from opensourcerouting/fix/show_ip_bgp_l2vpn_evpn_rd_neighb...
Donald Sharp [Fri, 13 May 2022 18:01:33 +0000 (14:01 -0400)]
Merge pull request #11198 from opensourcerouting/fix/show_ip_bgp_l2vpn_evpn_rd_neighbor_routes_unint

bgpd: Initialize prd for show_ip_bgp_l2vpn_evpn_rd_neighbor_routes()

2 years agoMerge pull request #11195 from anlancs/fix/lib-qsort
Donald Sharp [Fri, 13 May 2022 15:49:51 +0000 (11:49 -0400)]
Merge pull request #11195 from anlancs/fix/lib-qsort

lib: add one check in "list_sort()"

2 years agozebra: Add encap and group type decoding to nexthop dump
Donald Sharp [Fri, 13 May 2022 14:25:13 +0000 (10:25 -0400)]
zebra: Add encap and group type decoding to nexthop dump

Add the ability to give data about the nexthop group type
and encap type so that it is human readable.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10958 from patrasar/pim_passive
Jafar Al-Gharaibeh [Fri, 13 May 2022 13:39:12 +0000 (08:39 -0500)]
Merge pull request #10958 from patrasar/pim_passive

pimd: introduce ip pim passive command

2 years agobgpd: Add a bit of debug to give us data about how an update group is formed
Donald Sharp [Thu, 5 May 2022 15:21:20 +0000 (11:21 -0400)]
bgpd: Add a bit of debug to give us data about how an update group is formed

The creation of the update group is a tiny bit of a black box and is hard
to figure out by hand if it is correct.  Add a bit of code so that FRR
operators/developers can determine if the update group categorization
makes us happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Initialize prd for show_ip_bgp_l2vpn_evpn_rd_neighbor_routes()
Donatas Abraitis [Fri, 13 May 2022 12:41:16 +0000 (15:41 +0300)]
bgpd: Initialize prd for show_ip_bgp_l2vpn_evpn_rd_neighbor_routes()

*** CID 1517751:  Uninitialized variables  (UNINIT)
/bgpd/bgp_evpn_vty.c: 1648 in show_ip_bgp_l2vpn_evpn_rd_neighbor_routes()
1642
1643
1644            if (rd_all)
1645                    return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_neighbor,
1646                                                 peer, SHOW_DISPLAY_STANDARD, uj);
1647            else
>>>     CID 1517751:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized element of array "prd.val" when calling "bgp_show_ethernet_vpn".
1648                    return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_neighbor,
1649                                                 peer, SHOW_DISPLAY_STANDARD, uj);
1650     }
1651
1652     DEFUN(show_ip_bgp_l2vpn_evpn_neighbor_advertised_routes,
1653           show_ip_bgp_l2vpn_evpn_neighbor_advertised_routes_cmd,

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Make bgp_debug.[ch] take `const struct peer *` and return bool
Donald Sharp [Thu, 5 May 2022 15:31:33 +0000 (11:31 -0400)]
bgpd: Make bgp_debug.[ch] take `const struct peer *` and return bool

Several functions in bgp_debug.[ch] take a const struct peer *
and also return a bool instead of an int.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11197 from opensourcerouting/feature/gr_notification_docs
Donald Sharp [Fri, 13 May 2022 12:36:41 +0000 (08:36 -0400)]
Merge pull request #11197 from opensourcerouting/feature/gr_notification_docs

doc: Add some more documentation about Notification support for GR

2 years agobgpd: Fix no form of rpki commands to take values
Donald Sharp [Mon, 2 May 2022 16:36:22 +0000 (12:36 -0400)]
bgpd: Fix no form of rpki commands to take values

Fix the no forms of some rpki commands to take variable
values on the no form.  So that people cut-n-pasting while
adding a no works.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11194 from donaldsharp/untrusted
Donatas Abraitis [Fri, 13 May 2022 11:43:11 +0000 (14:43 +0300)]
Merge pull request #11194 from donaldsharp/untrusted

Some more Coverity issues solved

2 years agoMerge pull request #11177 from opensourcerouting/fix/memset_memcpy
Donald Sharp [Fri, 13 May 2022 11:40:58 +0000 (07:40 -0400)]
Merge pull request #11177 from opensourcerouting/fix/memset_memcpy

*: memcpy/memset zeroing

2 years agoMerge pull request #11188 from opensourcerouting/fix/argv_find
Donald Sharp [Fri, 13 May 2022 11:35:57 +0000 (07:35 -0400)]
Merge pull request #11188 from opensourcerouting/fix/argv_find

bgpd: Cleanup

2 years agoMerge pull request #9454 from anlancs/fix-ospf6-gr-length
Igor Ryzhov [Fri, 13 May 2022 11:25:06 +0000 (14:25 +0300)]
Merge pull request #9454 from anlancs/fix-ospf6-gr-length

ospf6d: suppress coverity warnings of insecure data handling

2 years agodoc: Add some more documentation about Notification support for GR
Donatas Abraitis [Fri, 13 May 2022 09:45:25 +0000 (12:45 +0300)]
doc: Add some more documentation about Notification support for GR

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotests: Inroduced pim passive test cases
sarita patra [Mon, 9 May 2022 11:03:52 +0000 (04:03 -0700)]
tests: Inroduced pim passive test cases

Co-authored-by: Vijay Kumar Gupta <vijayg@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Northbound support for pim passive enable
sarita patra [Wed, 4 May 2022 13:05:43 +0000 (06:05 -0700)]
pimd: Northbound support for pim passive enable

Added nothbound callbacks for pim-passive-enable

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving BSM on passive interface
sarita patra [Thu, 7 Apr 2022 07:09:01 +0000 (00:09 -0700)]
pimd: Disable receiving BSM on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving assert msg on passive interface
sarita patra [Thu, 7 Apr 2022 07:07:53 +0000 (00:07 -0700)]
pimd: Disable receiving assert msg on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving join/prune on passive interface
sarita patra [Thu, 7 Apr 2022 07:06:39 +0000 (00:06 -0700)]
pimd: Disable receiving join/prune on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving register-stop on passive interface
sarita patra [Thu, 7 Apr 2022 07:05:36 +0000 (00:05 -0700)]
pimd: Disable receiving register-stop on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving register msg on passive interface
sarita patra [Thu, 7 Apr 2022 07:04:21 +0000 (00:04 -0700)]
pimd: Disable receiving register msg on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable receiving hello on passive interface
sarita patra [Thu, 7 Apr 2022 07:02:52 +0000 (00:02 -0700)]
pimd: Disable receiving hello on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Handling hello send statistics for passive interface
sarita patra [Mon, 4 Apr 2022 11:14:54 +0000 (04:14 -0700)]
pimd: Handling hello send statistics for passive interface

Increment pim_ifstat_hello_sent only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Handling reg and reg_stop send statistics for passive interface
sarita patra [Mon, 4 Apr 2022 11:13:07 +0000 (04:13 -0700)]
pimd: Handling reg and reg_stop send statistics for passive interface

Increment pim_ifstat_reg_stop_send & pim_ifstat_reg_send when
interface is passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Handling Join/Prune statistics for passive interface
sarita patra [Mon, 4 Apr 2022 11:11:38 +0000 (04:11 -0700)]
pimd: Handling Join/Prune statistics for passive interface

Increment pim_ifstat_prune_send only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Handling BSM send statistics for passive interface
sarita patra [Mon, 4 Apr 2022 11:10:33 +0000 (04:10 -0700)]
pimd: Handling BSM send statistics for passive interface

Increment pim_ifstat_bsm_tx only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Handling assert send statistics for passive interface
sarita patra [Mon, 4 Apr 2022 11:08:42 +0000 (04:08 -0700)]
pimd: Handling assert send statistics for passive interface

Increment pim_ifstat_assert_send only when interface is
passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agodoc: add ip[v6] pim passive support
sarita patra [Mon, 4 Apr 2022 11:16:10 +0000 (04:16 -0700)]
doc: add ip[v6] pim passive support

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: display passive in show ip pim interface cmd
sarita patra [Thu, 7 Apr 2022 07:43:20 +0000 (00:43 -0700)]
pimd: display passive in show ip pim interface cmd

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: show ip[v6] pim passive in show running config
sarita patra [Mon, 4 Apr 2022 11:37:18 +0000 (04:37 -0700)]
pimd: show ip[v6] pim passive in show running config

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Disable sending of control packets on passive interface
sarita patra [Mon, 4 Apr 2022 11:37:56 +0000 (04:37 -0700)]
pimd: Disable sending of control packets on passive interface

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: introduced flags for pim_passive_enable
sarita patra [Thu, 7 Apr 2022 12:34:07 +0000 (05:34 -0700)]
pimd: introduced flags for pim_passive_enable

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopim6d: introduce ipv6 pim passive command
sarita patra [Mon, 4 Apr 2022 11:01:45 +0000 (04:01 -0700)]
pim6d: introduce ipv6 pim passive command

Added a new cli command "ip pim passive" in the interface context,
to disable sending of pim control packets on the interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: introduce ip pim passive command
sarita patra [Thu, 7 Apr 2022 07:41:14 +0000 (00:41 -0700)]
pimd: introduce ip pim passive command

Added a new cli command "ip pim passive" in the interface context,
to disable sending of pim control packets on the interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #11190 from donaldsharp/bgp_data
Donatas Abraitis [Fri, 13 May 2022 06:00:08 +0000 (09:00 +0300)]
Merge pull request #11190 from donaldsharp/bgp_data

Fix #11178 and various other cleanup

2 years agolib: add one check in "list_sort()"
anlan_cs [Fri, 13 May 2022 02:14:11 +0000 (22:14 -0400)]
lib: add one check in "list_sort()"

Add one check in `list_sort()`:
Immediatly return if no any items in this list.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobfdd: Prevent coverity from thinking values are uninited
Donald Sharp [Thu, 12 May 2022 20:58:29 +0000 (16:58 -0400)]
bfdd: Prevent coverity from thinking values are uninited

Coverity is claiming that bfdd is able got have bglobal.bg_use_dplane
can be true, while dplane_addr can be uninitialized.  Not really
possible since global variables are initialized to all 0's.  In
any event.  Force it to think it can't go there.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Assign large enough data structure for coverity to be happy
Donald Sharp [Thu, 12 May 2022 20:47:05 +0000 (16:47 -0400)]
bgpd: Assign large enough data structure for coverity to be happy

When implementing the bgp_packet_mpunreach_prefix a uint8_t array
of 3 bytes was created and then assigned to a label type, which
is 4 bytes and then various pointer work is done on it.  Eventually
coverity is complaining that the 3 -vs- 4 bytes is not enough
to properly dereference it.  Just make the uint8_t 4 bytes
and be done with it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobabeld: Check that bodylen is within some bounds of usable
Donald Sharp [Thu, 12 May 2022 17:23:36 +0000 (13:23 -0400)]
babeld: Check that bodylen is within some bounds of usable

Coverity believed that the bodylen value was read directly
from the incoming packet and then used as a loop variable.
Unfortunately it missed the fact that in babel_packet_examin
the bodylen was actually checked to ensure that it was long
enough.  So instead of checking it 2 times, generate it one
time and let coverity figure it out from that.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_dump.h to our standards
Donald Sharp [Thu, 12 May 2022 13:18:38 +0000 (09:18 -0400)]
bgpd: Align bgp_dump.h to our standards

bgp_dump.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_debug.h to our standards
Donald Sharp [Thu, 12 May 2022 13:17:07 +0000 (09:17 -0400)]
bgpd: Align bgp_debug.h to our standards

bgp_debug.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_damp.h to our standards
Donald Sharp [Thu, 12 May 2022 13:13:40 +0000 (09:13 -0400)]
bgpd: Align bgp_damp.h to our standards

bgp_damp.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_community.h to our standards
Donald Sharp [Thu, 12 May 2022 13:11:07 +0000 (09:11 -0400)]
bgpd: Align bgp_community.h to our standards

bgp_community.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_clist.h to our standards
Donald Sharp [Thu, 12 May 2022 13:08:12 +0000 (09:08 -0400)]
bgpd: Align bgp_clist.h to our standards

bgp_clist.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_attr.h to our standards
Donald Sharp [Thu, 12 May 2022 13:03:49 +0000 (09:03 -0400)]
bgpd: Align bgp_attr.h to our standards

bgp_attr.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_aspath.h to our standards
Donald Sharp [Thu, 12 May 2022 13:00:46 +0000 (09:00 -0400)]
bgpd: Align bgp_aspath.h to our standards

bgp_aspath.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_advertise.h to our standards
Donald Sharp [Thu, 12 May 2022 12:53:01 +0000 (08:53 -0400)]
bgpd: Align bgp_advertise.h to our standards

bgp_advertise.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_zebra.h to our standards
Donald Sharp [Thu, 12 May 2022 12:28:11 +0000 (08:28 -0400)]
bgpd: Align bgp_zebra.h to our standards

bgp_zebra.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Align bgp_mpath.h to our standards
Donald Sharp [Thu, 12 May 2022 12:11:46 +0000 (08:11 -0400)]
bgpd: Align bgp_mpath.h to our standards

The bgp_mpath.h file was missing some variable names.  Let's
add them in to align with our standard for header files.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Change single value bitfield to a bool
Donald Sharp [Thu, 12 May 2022 12:06:14 +0000 (08:06 -0400)]
bgpd: Change single value bitfield to a bool

The maxpaths same_clusterlen value was a uint16_t
with a single bit being used.  No other values are
being stored.  Let's remove the bitfield and simplify
to a bool.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Prevent crash when issuing various forms of `bgp no-rib`
Donald Sharp [Thu, 12 May 2022 13:39:27 +0000 (09:39 -0400)]
bgpd: Prevent crash when issuing various forms of `bgp no-rib`

The `bgp no-rib` command cycles through all the bgp rib tables
and removes them from zebra.  Modify the code so that FRR notices
that it is attempting to cycle through the safi's that are two level
tables.  In addition these safi's cannot just blindly remove the routes
from the rib as that there are none explicitly.

This code just prevents the crash in bgpd.  It does not properly cycle
through and remove the zebra changes made that are explicit to these afi's.
This should be handled as appropriate by the developers on these safi's when
it becomes important to them.

Fixes: #11178
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11176 from anlancs/fix/bgpd-remove-for-type2-prefix
Donatas Abraitis [Thu, 12 May 2022 10:28:51 +0000 (13:28 +0300)]
Merge pull request #11176 from anlancs/fix/bgpd-remove-for-type2-prefix

bgpd: remove unncessary check for evpn

2 years agoMerge pull request #11186 from anlancs/fix/bgpd-comment-should-es
Donatas Abraitis [Thu, 12 May 2022 08:32:25 +0000 (11:32 +0300)]
Merge pull request #11186 from anlancs/fix/bgpd-comment-should-es

bgpd,zebra: correct one debug log for evpn-mh

2 years agobgpd: Check and validate return value for str2ipaddr()
Donatas Abraitis [Thu, 12 May 2022 07:28:06 +0000 (10:28 +0300)]
bgpd: Check and validate return value for str2ipaddr()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Check argv_find() value instead of the index
Donatas Abraitis [Thu, 12 May 2022 07:23:28 +0000 (10:23 +0300)]
bgpd: Check argv_find() value instead of the index

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotools: Catch more argv_find() when not checked properly
Donatas Abraitis [Thu, 12 May 2022 07:09:42 +0000 (10:09 +0300)]
tools: Catch more argv_find() when not checked properly

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Reuse index from argv_find only if found
Donatas Abraitis [Thu, 12 May 2022 06:57:13 +0000 (09:57 +0300)]
bgpd: Reuse index from argv_find only if found

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd,zebra: correct one debug log for evpn-mh
anlan_cs [Thu, 12 May 2022 01:25:47 +0000 (21:25 -0400)]
bgpd,zebra: correct one debug log for evpn-mh

Correct one debug log in evpn-mh.
BTW, correct one misspelled word in comment.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoBGPD: fix invalid bmp POST POLICY flag
Francois Dumontet [Wed, 11 May 2022 13:33:12 +0000 (15:33 +0200)]
BGPD: fix invalid bmp POST POLICY flag

description:
BMP Per Peer Headers of Route Monitoring messages with UPDATE and
WITHDRAW notificatiosn ( not the sync ones at Initiation) are
all typed as POST POLICY.

fix:
notify Pre policy UPDATES AND WITHDRAWS with  Per Peer Header type set
to PRE POLICY (0)

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2 years ago*: Properly use memset() when zeroing
Donatas Abraitis [Wed, 11 May 2022 10:16:44 +0000 (13:16 +0300)]
*: Properly use memset() when zeroing

    Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoripd: Use correct usage of memcpy() when zeroing struct
Donatas Abraitis [Wed, 11 May 2022 10:14:01 +0000 (13:14 +0300)]
ripd: Use correct usage of memcpy() when zeroing struct

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotools: Add coccinelle script to catch memset/memcpy wrong usage
Donatas Abraitis [Wed, 11 May 2022 10:12:22 +0000 (13:12 +0300)]
tools: Add coccinelle script to catch memset/memcpy wrong usage

Wrong: memset(&a, 0, sizeof(struct ...));
Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Use sizeof() for memset instead of numeric
Donatas Abraitis [Wed, 11 May 2022 10:10:23 +0000 (13:10 +0300)]
bgpd: Use sizeof() for memset instead of numeric

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11151 from opensourcerouting/pim-various-20220506
mobash-rasool [Wed, 11 May 2022 04:34:18 +0000 (10:04 +0530)]
Merge pull request #11151 from opensourcerouting/pim-various-20220506

pimd, pim6d: fix various smaller issues

2 years agobgpd: remove unncessary check for evpn
anlan_cs [Wed, 11 May 2022 01:48:50 +0000 (21:48 -0400)]
bgpd: remove unncessary check for evpn

In current code, `build_evpn_type2_prefix()` doesn't distinguish ARP
according to the `ip` parameter. The `ip` parameter from caller is
always non-NULL.

Be consistent and not confused, just remove the unnecessary check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11155 from LabNConsulting/ziemba/link-delay-min-max
Mark Stapp [Tue, 10 May 2022 15:31:52 +0000 (11:31 -0400)]
Merge pull request #11155 from LabNConsulting/ziemba/link-delay-min-max

zebra bugfix interface link-param: allow delay min <= avg <= max (was: min<avg<max)

2 years agoMerge pull request #11160 from opensourcerouting/feature/BGP_NOTIFY_CEASE_ADMIN_RESET...
Russ White [Tue, 10 May 2022 15:25:13 +0000 (11:25 -0400)]
Merge pull request #11160 from opensourcerouting/feature/BGP_NOTIFY_CEASE_ADMIN_RESET_hard_reset

bgpd: Send Hard Reset Notification for BGP_NOTIFY_CEASE_ADMIN_RESET

2 years agoospf6d: add header size check for LSA
anlan_cs [Wed, 19 Jan 2022 01:24:01 +0000 (20:24 -0500)]
ospf6d: add header size check for LSA

Add header size check for safe. If the check fails, just jump out of current
function.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: Reset bgp_notify.hard_reset on receive to avoid stale data
Donatas Abraitis [Tue, 10 May 2022 06:25:59 +0000 (09:25 +0300)]
bgpd: Reset bgp_notify.hard_reset on receive to avoid stale data

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Send Hard Reset Notification for BGP_NOTIFY_CEASE_ADMIN_RESET
Donatas Abraitis [Fri, 6 May 2022 07:21:15 +0000 (10:21 +0300)]
bgpd: Send Hard Reset Notification for BGP_NOTIFY_CEASE_ADMIN_RESET

`clear bgp neighbor` should send Hard Reset and graceful restart should be
activated. Let's make this adjustable.

https://datatracker.ietf.org/doc/html/rfc8538#section-5.1

   +-------+------------------------------------+----------------------+
   | Value |                Name                |  Suggested Behavior  |
   +-------+------------------------------------+----------------------+
   |   1   | Maximum Number of Prefixes Reached |      Hard Reset      |
   |   2   |      Administrative Shutdown       |      Hard Reset      |
   |   3   |         Peer De-configured         |      Hard Reset      |
   |   4   |        Administrative Reset        | Provide user control |
   |   5   |        Connection Rejected         |    Graceful Cease    |
   |   6   |     Other Configuration Change     |    Graceful Cease    |
   |   7   |  Connection Collision Resolution   |    Graceful Cease    |
   |   8   |          Out of Resources          |    Graceful Cease    |
   |   9   |             Hard Reset             |      Hard Reset      |
   +-------+------------------------------------+----------------------+

Enabled by default.

Co-authored-by: Biswajit Sadhu <biswajit.sadhu@gmail.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11138 from opensourcerouting/fix/rpki
Russ White [Mon, 9 May 2022 23:36:02 +0000 (19:36 -0400)]
Merge pull request #11138 from opensourcerouting/fix/rpki

bgpd: RPKI reverts, nits...

2 years agoMerge pull request #11147 from opensourcerouting/feature/gr_n-bit_cli_knob
Russ White [Mon, 9 May 2022 23:35:14 +0000 (19:35 -0400)]
Merge pull request #11147 from opensourcerouting/feature/gr_n-bit_cli_knob

bgpd: Add CLI knob to enable graceful restart for BGP notifications

2 years agoMerge pull request #11148 from anlancs/fix/bfdd-wrong-discriminator-mismatch
Igor Ryzhov [Mon, 9 May 2022 21:32:08 +0000 (00:32 +0300)]
Merge pull request #11148 from anlancs/fix/bfdd-wrong-discriminator-mismatch

bfdd: fix override between sessions

2 years agoMerge pull request #11163 from opensourcerouting/fix/same_type_casting
Igor Ryzhov [Mon, 9 May 2022 21:16:30 +0000 (00:16 +0300)]
Merge pull request #11163 from opensourcerouting/fix/same_type_casting

*: Avoid casting to the same type as on the left

2 years agoMerge pull request #11154 from opensourcerouting/fix/increase_bgp_flags
Russ White [Mon, 9 May 2022 18:50:29 +0000 (14:50 -0400)]
Merge pull request #11154 from opensourcerouting/fix/increase_bgp_flags

bgpd: Use uint64_t for bgp->flags

2 years agoMerge pull request #11161 from opensourcerouting/fix/no_need_to_check_for_xcalloc
Russ White [Mon, 9 May 2022 18:44:36 +0000 (14:44 -0400)]
Merge pull request #11161 from opensourcerouting/fix/no_need_to_check_for_xcalloc

zebra, ospf6d: Do not check if NULL for XCALLOC()

2 years agoMerge pull request #11162 from anlancs/fix/bgpd-cleanup-5
Russ White [Mon, 9 May 2022 18:43:03 +0000 (14:43 -0400)]
Merge pull request #11162 from anlancs/fix/bgpd-cleanup-5

bgpd: remove unnecessary check for evpn

2 years agoMerge pull request #11170 from anlancs/fix/bgpd-cleanup-8
mobash-rasool [Mon, 9 May 2022 17:12:22 +0000 (22:42 +0530)]
Merge pull request #11170 from anlancs/fix/bgpd-cleanup-8

bgpd: remove one unnecessary parameter for evpn-mh

2 years agoMerge pull request #11096 from anlancs/fix/bgpd-unlock
Russ White [Mon, 9 May 2022 14:46:50 +0000 (10:46 -0400)]
Merge pull request #11096 from anlancs/fix/bgpd-unlock

bgpd: clear misleading mismatched check

2 years agobgpd: remove one unnecessary parameter for evpn-mh
anlan_cs [Wed, 13 Apr 2022 11:06:39 +0000 (07:06 -0400)]
bgpd: remove one unnecessary parameter for evpn-mh

The "add" parameter of `bgp_evpn_mh_route_update()` makes no sense.
Just remove it to clarify this function, and remove the relevant check
with "add" as well.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: remove unnecessary check for evpn
anlan_cs [Fri, 6 May 2022 09:52:12 +0000 (05:52 -0400)]
bgpd: remove unnecessary check for evpn

When `bgp_evpn_new()` is called, the `bgp` parameter MUST be non-NULL,
remove this unnecessary check and remove the NULL check for returned
`struct bgpevpn *`, which should be non-NULL.

And modify `import_rt_new()` in the same way.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years ago*: Avoid casting to the same type as on the left
Donatas Abraitis [Sun, 8 May 2022 13:07:42 +0000 (16:07 +0300)]
*: Avoid casting to the same type as on the left

Just not necessary.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agozebra, ospf6d: Do not check if NULL for XCALLOC()
Donatas Abraitis [Sun, 8 May 2022 12:43:21 +0000 (15:43 +0300)]
zebra, ospf6d: Do not check if NULL for XCALLOC()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: clear misleading mismatched check
anlan_cs [Tue, 26 Apr 2022 04:14:34 +0000 (00:14 -0400)]
bgpd: clear misleading mismatched check

Two changes for `delete_global_type2_routes()`:

1) Remove check of `bgp_dest_has_bgp_path_info_data(rddest)`.
It is unnecessary(`dest->info` should not be NULL) and misleading.
`if (rddest && bgp_dest_has_bgp_path_info_data(rddest))`
Use (locked) node with this check, but unlock with `if (rddest)`,
The mismatched condition is misleading, there seems to be a
mistake to extra unlock.
Just make it clear, immediately exit with `(!rddest)`.

2) Remove checking returned value for it, and use `void` as return type.
It is unnecessary and wrong. Even the check failed, it should continue
to delete other types of routes.
Just remove the check and go through.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11156 from donaldsharp/spelling_three
Donatas Abraitis [Sat, 7 May 2022 15:44:59 +0000 (18:44 +0300)]
Merge pull request #11156 from donaldsharp/spelling_three

valgrind issues and general cleanup

2 years agoisisd: Prevent direct copy of different size prefix'es
Donald Sharp [Sat, 7 May 2022 01:24:56 +0000 (21:24 -0400)]
isisd: Prevent direct copy of different size prefix'es

Memory is allocated for a `struct prefix_ipv6` but
it was directly copied into a `struct prefix` via
direct pointer copy, which leads to a read past
end of memory.  Fix by using prefix_copy

Signed-off-by: Donald Sharp <sharpd@nvidia.com>