mirror_frr/zebra
Donald Sharp a0bcf644d6 zebra: Ensure non-equal id's are not same nhg's
The function zebra_nhg_hash_equal is only used
as a hash function for storage of NHG's and retrieval.
If you have say two nhg's:

31 (25/26)
32 (25/26)

This function would return them as being equal.  Which
of course leads to the problem when you attempt to
hash_release 32 but release 31 from the hash.  Then later
when you attempt to do hash comparisons 32 has actually
been freed leaving to use after free situations and shit
goes down hill fast.

This hash is only used as part of the hash comparison
function for nexthop group storage.  Since this is so
let's always return the 31/32 nhg's are not equal at all.

We possibly have a different problem where we are creating
31 and 32 ( when 31 should have just been used instead of 32 )
but we need to prevent any type of hash release problem at all.
This supercedes any other issue( that should be tracked down
on it's own ).  Since you can have use after free situation
that leads to a crash -vs- some possible nexthop group duplication
which is very minor in comparison.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 5a1b61aeba)
2024-08-12 19:00:50 +00:00
..
dpdk zebra: Update Zebra for DPDK >=22.11 API 2024-05-16 14:26:26 +03:00
.gitignore zebra: Add fpm_listener 2024-03-04 11:06:35 -05:00
connected.c zebra: Add connected with noprefixroute 2023-12-06 09:27:52 -05:00
connected.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
debug_nl.c zebra: add some more netlink RTA_ strings 2024-05-09 16:56:07 -04:00
debug.c zebra: add zebra to mgmtd oper-state 2023-12-28 17:53:40 +00:00
debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
dplane_fpm_nl.c zebra: fix incoming FPM message length validation 2024-06-05 14:37:41 -04:00
fpm_listener.c Merge pull request #15082 from louis-6wind/fix-iff-lower-up 2024-05-29 00:01:20 +03:00
ge_netlink.c zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
ge_netlink.h zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
if_ioctl.c *: Remove sys/ioctl.h from zebra.h 2024-01-04 14:42:17 -05:00
if_netlink.c zebra: clean up one comment 2024-05-02 16:36:01 +08:00
if_netlink.h zebra: Move protodown_r_bit to a better spot 2023-07-05 11:49:36 -04:00
if_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
if_sysctl.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
interface.c zebra: Fix to avoid two Vrfs with same table ids 2024-07-14 00:14:24 +00:00
interface.h zebra: Remove ifp_nhg_XXX functions completely 2024-02-08 11:56:40 -05:00
ioctl.c *: Remove sys/ioctl.h from zebra.h 2024-01-04 14:42:17 -05:00
ioctl.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_proc.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_sysctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
irdp_interface.c zebra: convert interface configuration output to NB 2024-01-28 23:28:40 +02:00
irdp_main.c *: convert struct interface->connected to DLIST 2023-11-22 23:00:30 +01:00
irdp_packet.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
irdp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
kernel_netlink.c zebra: Ensure proper decoding of netlink message 2024-04-30 14:46:08 -04:00
kernel_netlink.h zebra: Add Generic Netlink socket 2023-12-14 14:56:44 +01:00
kernel_socket.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
kernel_socket.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
label_manager.c zebra: Cleanup linked list on shutdown in label manager 2023-12-11 15:26:20 -05:00
label_manager.h zebra: Cleanup linked list on shutdown in label manager 2023-12-11 15:26:20 -05:00
main.c *: Modify agentx to be allowed to be called 2024-05-10 10:16:29 -04:00
Makefile build: convert zebra/ to non-recursive build 2017-07-31 23:03:30 +02:00
netconf_netlink.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
netconf_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
redistribute.c zebra: Move nhg reinstallation into if_up proper 2024-02-08 12:22:09 -05:00
redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rib.h zebra: Reorg struct route_entry to have important bits first 2024-02-05 14:17:55 -05:00
router-id.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
router-id.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
rt_netlink.c Merge pull request #16008 from mjstapp/show_routemap_source 2024-05-15 06:18:41 -04:00
rt_netlink.h zebra: support route replace semantics in FPM 2023-09-04 15:38:03 -03:00
rt_socket.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
rt.h *: Introduce Local Host Routes to FRR 2023-11-01 17:13:06 -04:00
rtadv.c zebra: rtadv uses uninited data to sendmsg 2024-04-10 09:24:13 -04:00
rtadv.h zebra: convert interface ipv6 nd dnssl command to NB 2024-01-28 23:28:40 +02:00
rtread_netlink.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rtread_sysctl.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
rule_netlink.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
rule_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rule_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
sample_plugin.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
subdir.am zebra: Add show fpm status [json] command 2024-03-04 11:06:35 -05:00
table_manager.c lib, mgmtd, zebra: cleanup of zebra conversion to mgmtd 2024-01-28 23:46:38 +02:00
table_manager.h zebra: convert table range command to NB 2024-01-28 23:28:40 +02:00
tc_netlink.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
tc_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
tc_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
testrib.conf
zapi_msg.c *: Use uint64_t for weight down the path to Zebra 2024-04-22 17:50:08 +03:00
zapi_msg.h lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c 2024-01-22 12:14:59 -05:00
zebra_affinitymap.c zebra: rework affinity-map update hook 2024-01-19 03:47:11 +02:00
zebra_affinitymap.h lib,zebra: add affinity-map configuration hooks 2023-02-10 13:52:01 +01:00
zebra_cli.c lib, zebra: fix exit commands 2024-04-16 22:18:01 +03:00
zebra_cli.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_dplane.c zebra: Prevent starvation in dplane_thread_loop 2024-06-19 07:23:26 +00:00
zebra_dplane.h zebra: add dataplane API version value 2024-04-09 08:59:13 -04:00
zebra_errors.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_errors.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_evpn_mac.c zebra: Use more appropriately sized stream packets for evpn 2024-04-09 10:08:03 -04:00
zebra_evpn_mac.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_evpn_mh.c bgpd, lib, zebra: Extend ES_VTEP_LIST_STR_SZ to support IPv6 addresses 2024-05-31 10:27:22 -04:00
zebra_evpn_mh.h zebra: bridge flap handle vlan membership update 2024-05-03 10:52:33 -07:00
zebra_evpn_neigh.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_evpn_neigh.h *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_evpn_vxlan.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_evpn.c zebra: Use more appropriately sized stream packets for evpn 2024-04-09 10:08:03 -04:00
zebra_evpn.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_fpm_dt.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_fpm_netlink.c zebra: changes for code maintainability 2024-03-12 12:00:12 +05:30
zebra_fpm_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm_protobuf.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_gr.c zebra: Cleanup leaked memory on shutdown from GR code 2024-03-12 21:18:02 -04:00
zebra_l2_bridge_if.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
zebra_l2_bridge_if.h zebra: multiple vlan aware bridge data structure and related changes 2023-02-13 18:12:04 -05:00
zebra_l2.c zebra: bridge flap handle vlan membership update 2024-05-03 10:52:33 -07:00
zebra_l2.h zebra: Use zebra dplane for RTM link and addr 2023-07-05 13:03:14 -04:00
zebra_mlag_private.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
zebra_mlag_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag.c *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_mlag.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_netlink.c *: remove sys/stat.h from zebra.h 2024-01-09 12:39:23 -05:00
zebra_mpls_null.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_openbsd.c zebra: changes for code maintainability 2024-03-21 14:56:24 +05:30
zebra_mpls_vty.c zebra: fix mpls command 2024-05-16 23:30:41 +08:00
zebra_mpls.c zebra: fix mpls command 2024-05-16 23:30:41 +08:00
zebra_mpls.h zebra: fix wrong check for mpls label 2024-04-06 09:01:39 +08:00
zebra_mroute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mroute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nb_config.c zebra: fix encoded DNSSL length 2024-04-15 23:31:26 +03:00
zebra_nb_rpcs.c zebra: clear evpn dup-addr return error-msg when there is no vni 2024-06-25 05:08:02 +00:00
zebra_nb_state.c yang: add missing zif-gre zebra interface type 2024-04-20 08:04:00 -04:00
zebra_nb.c Merge pull request #15397 from idryzhov/zebra-oper 2024-03-05 11:41:35 -05:00
zebra_nb.h Merge pull request #15397 from idryzhov/zebra-oper 2024-03-05 11:41:35 -05:00
zebra_neigh.c zebra: changes for code maintainability 2024-03-26 10:21:45 +05:30
zebra_neigh.h zebra: Remove static ARP entries on interface down events 2023-11-06 15:00:59 +02:00
zebra_netns_id.c zebra: changes for code maintainability 2024-03-26 10:21:45 +05:30
zebra_netns_id.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_netns_notify.c zebra: fix compilation with GCC14 2024-06-04 13:35:57 +03:00
zebra_netns_notify.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg.c zebra: Ensure non-equal id's are not same nhg's 2024-08-12 19:00:50 +00:00
zebra_nhg.h zebra: When reinstalling a NHG, set REINSTALL flag 2024-02-08 12:32:26 -05:00
zebra_ns.c zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_ns.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_opaque.c zebra: clean up coverity warning in opaque api 2023-06-26 13:19:23 -04:00
zebra_opaque.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_pbr.c *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_pbr.h *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_ptm_redistribute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm_redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_ptm.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_pw.c zebra: Properly unregister hook on shutdown 2023-12-11 15:22:07 -05:00
zebra_pw.h zebra: Properly unregister hook on shutdown 2023-12-11 15:22:07 -05:00
zebra_rib.c Merge pull request #15216 from donaldsharp/zebra_opaque_mem_leak 2024-02-02 10:54:20 -06:00
zebra_rnh.c zebra, lib: move nexthop display helper to lib folder 2024-05-15 15:33:52 +02:00
zebra_rnh.h zebra: include route source set by route-map in show output 2024-05-14 10:28:17 -04:00
zebra_routemap_nb_config.c *: Add missing SPDX-License-Identifier for some .c/.h files 2024-03-21 16:46:58 +02:00
zebra_routemap_nb.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap_nb.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap.c zebra: Deny the routes if ip protocol CLI refers to an undefined rmap 2024-05-20 12:50:18 -07:00
zebra_routemap.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_router.c zebra: support yielding between oper state routes query 2023-12-28 17:53:40 +00:00
zebra_router.h zebra: support yielding between oper state routes query 2023-12-28 17:53:40 +00:00
zebra_script.c zebra: Add code to set SRv6 encap source addr in dplane 2023-12-14 14:56:44 +01:00
zebra_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_snmp.c *: Introduce Local Host Routes to FRR 2023-11-01 17:13:06 -04:00
zebra_srte.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srte.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6_vty.c zebra: display srv6 encapsulation source-address when configured 2024-06-04 09:55:21 +02:00
zebra_srv6_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6.c zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
zebra_srv6.h zebra, lib, vtysh: Add CLI cmd to set/unset SRv6 encap source address 2023-12-14 14:58:33 +01:00
zebra_tc.c zebra: Set Free Functions for Traffic Control Hash Tables 2023-11-29 16:33:54 +04:00
zebra_tc.h zebra: Set Free Functions for Traffic Control Hash Tables 2023-11-29 16:33:54 +04:00
zebra_trace.c *: Add missing SPDX-License-Identifier for some .c/.h files 2024-03-21 16:46:58 +02:00
zebra_trace.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_vrf.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_vrf.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_vty.c zebra: Properly note that a nhg's nexthop has gone down 2024-07-23 14:50:46 +00:00
zebra_vxlan_if.c zebra: bridge flap handle vlan membership update 2024-05-03 10:52:33 -07:00
zebra_vxlan_if.h zebra: Fix for mcast-group update and delete per vni for svd 2023-02-13 18:12:05 -05:00
zebra_vxlan_private.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_vxlan.c lib, zebra: Update prefix_sg structure for IPv6 group support 2024-05-31 10:27:22 -04:00
zebra_vxlan.h zebra: fix vni NB conversion 2024-01-28 23:28:40 +02:00
zserv.c zebra: Actually display I/O buffer sizes 2024-04-09 10:08:03 -04:00
zserv.h zebra: Cleanup leaked memory on shutdown from GR code 2024-03-12 21:18:02 -04:00