summaryrefslogtreecommitdiff
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-07-11 13:08:01 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-07-11 13:08:01 +0000
commit11bea989279a2b6b2caab39b36c5d2aaf0a55e7b (patch)
treee9740a59ec56cf9471c4b90ad122b11faddb3413 /sys/netinet/in_pcb.c
parentd9ca78a898bdae4f5c7affe683238f54b1ba94d2 (diff)
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@
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c24
1 files changed, 6 insertions, 18 deletions
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);
}
/*