From 5365c565771df4adb7e0805d7dfbc860e9b9ecf1 Mon Sep 17 00:00:00 2001 From: hengwu0 <17380582683@163.com> Date: Mon, 25 Mar 2024 16:51:56 +0800 Subject: [PATCH] zebra: Always receive RS zebra: The socket is listening on ND_ROUTER_SOLICIT of icmpv6, but won't recv it when RA is disabled. It will let packets accumulate in kernel. We should always receive RS packets regardless of whether RA is disabled. Signed-off-by: hengwu0 <17380582683@163.com> --- zebra/rtadv.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 6aca643bd8e2..7a506698838b 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -1262,9 +1262,6 @@ static void rtadv_start_interface_events(struct zebra_vrf *zvrf, return; /* Already added */ if_join_all_router(zvrf->rtadv.sock, zif->ifp); - - if (adv_if_list_count(&zvrf->rtadv.adv_if) == 1) - rtadv_event(zvrf, RTADV_START, 0); } void ipv6_nd_suppress_ra_set(struct interface *ifp, @@ -1292,9 +1289,6 @@ void ipv6_nd_suppress_ra_set(struct interface *ifp, adv_if_free(adv_if); if_leave_all_router(zvrf->rtadv.sock, ifp); - - if (adv_if_list_count(&zvrf->rtadv.adv_if) == 0) - rtadv_event(zvrf, RTADV_STOP, 0); } } else { if (!zif->rtadv.AdvSendAdvertisements) { @@ -1836,6 +1830,9 @@ void rtadv_vrf_init(struct zebra_vrf *zvrf) return; zvrf->rtadv.sock = rtadv_make_socket(zvrf->zns->ns_id); + + /* Always receive RS, no matter RA is disabled or not */ + rtadv_event(zvrf, RTADV_START, 0); } void rtadv_vrf_terminate(struct zebra_vrf *zvrf)