While looking into filtering out messages for L2 routes in the kernel to reduce load on routing daemons, I noticed that the RTM_DELETE messages do not have the RTF_LLINFO flag set, which is inconvenient because that's what I want to filter on.
I tracked this down to r1.361 and r1.362 of net/route.c, where we stopped saving rt->rt_flags before calling rtrequest_delete(). rtrequest_delete() calls ifp->if_rtrequest(), which removes the llinfo from the route and clears RTF_LLINFO. I think the simplest way to fix this would be for rtdeletemsg() to go back to calling rtm_miss() directly rather than using rtm_send(). Adding more parameters to rtm_send() to specify additional flags seems like overcomplicating it. Index: route.c =================================================================== RCS file: /cvs/src/sys/net/route.c,v retrieving revision 1.394 diff -u -p -r1.394 route.c --- route.c 24 Jun 2020 22:03:43 -0000 1.394 +++ route.c 11 Aug 2020 04:12:51 -0000 @@ -663,6 +663,7 @@ rtdeletemsg(struct rtentry *rt, struct i { int error; struct rt_addrinfo info; + struct sockaddr_rtlabel sa_rl; struct sockaddr_in6 sa_mask; KASSERT(rt->rt_ifidx == ifp->if_index); @@ -677,8 +678,13 @@ rtdeletemsg(struct rtentry *rt, struct i info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; if (!ISSET(rt->rt_flags, RTF_HOST)) info.rti_info[RTAX_NETMASK] = rt_plen2mask(rt, &sa_mask); + info.rti_info[RTAX_LABEL] = rtlabel_id2sa(rt->rt_labelid, &sa_rl); + info.rti_flags = rt->rt_flags; + info.rti_info[RTAX_IFP] = sdltosa(ifp->if_sadl); + info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; error = rtrequest_delete(&info, rt->rt_priority, ifp, &rt, tableid); - rtm_send(rt, RTM_DELETE, error, tableid); + rtm_miss(RTM_DELETE, &info, info.rti_flags, rt->rt_priority, + rt->rt_ifidx, error, tableid); if (error == 0) rtfree(rt); return (error);