From: claudio Date: Wed, 11 Jul 2018 13:08:00 +0000 (+0000) Subject: Retire RTM_LOSING, it no longer makes sense and on busy servers the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5e85553aa96e9952aa87c842410d92e36ab047e0;p=openbsd Retire RTM_LOSING, it no longer makes sense and on busy servers the route socket is flooded with those messages. Instead maek sure that the removal of the dynamic route that can happen is actually also sent to the routing socket. OK mpi@ henning@ --- diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index d2626718533..93a45ee4426 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.239 2018/06/14 17:16:03 bluhm Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.240 2018/07/11 13:08:00 claudio Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -709,21 +709,11 @@ in_pcbnotifyall(struct inpcbtable *table, struct sockaddr *dst, u_int rtable, void in_losing(struct inpcb *inp) { - struct rtentry *rt; - struct rt_addrinfo info; - struct sockaddr_in6 sa_mask; + struct rtentry *rt = inp->inp_route.ro_rt; - if ((rt = inp->inp_route.ro_rt)) { - inp->inp_route.ro_rt = 0; - - memset(&info, 0, sizeof(info)); - info.rti_flags = rt->rt_flags; - info.rti_info[RTAX_DST] = &inp->inp_route.ro_dst; - info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - info.rti_info[RTAX_NETMASK] = rt_plen2mask(rt, &sa_mask); + if (rt) { + inp->inp_route.ro_rt = NULL; - rtm_miss(RTM_LOSING, &info, rt->rt_flags, rt->rt_priority, - rt->rt_ifidx, 0, inp->inp_rtableid); if (rt->rt_flags & RTF_DYNAMIC) { struct ifnet *ifp; @@ -734,10 +724,8 @@ in_losing(struct inpcb *inp) * so we're dealing with a stale cache and have * nothing to do. */ - if (ifp != NULL) { - rtrequest_delete(&info, rt->rt_priority, ifp, - NULL, inp->inp_rtableid); - } + if (ifp != NULL) + rtdeletemsg(rt, ifp, inp->inp_rtableid); if_put(ifp); } /*