From 725d9f5945569904938db311871931e2718330f1 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 9 Aug 2022 20:09:03 -0400 Subject: [PATCH] zebra: No need for a rib_delete before a rib_add In kernel_socket.c, the code is deleting and then adding the route back in on a change operation. This just translates too two re's, one for deletion and one for addition. The deletion will just be ignored. Let's not do the extra deletion. Signed-off-by: Donald Sharp --- zebra/kernel_socket.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index cb549339af..4c089ee194 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -1112,14 +1112,6 @@ void rtm_read(struct rt_msghdr *rtm) } else return; - /* - * CHANGE: delete the old prefix, we have no further information - * to specify the route really - */ - if (rtm->rtm_type == RTM_CHANGE) - rib_delete(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, - 0, zebra_flags, &p, NULL, NULL, 0, RT_TABLE_MAIN, 0, - 0, true); if (rtm->rtm_type == RTM_GET || rtm->rtm_type == RTM_ADD || rtm->rtm_type == RTM_CHANGE) rib_add(afi, SAFI_UNICAST, VRF_DEFAULT, proto, 0, zebra_flags, -- 2.39.5