summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-02-05 03:01:03 +0000
committermpi <mpi@openbsd.org>2015-02-05 03:01:03 +0000
commit8036030af59dfb27817b79b67b4ba2e6c12afdd3 (patch)
tree6ac73ce0fddcaf8c2d7bda7496ccf6ecd93acb6a /sys/netinet6/icmp6.c
parentmacro fixes from Kaspars at Bankovskis dot net; (diff)
downloadwireguard-openbsd-8036030af59dfb27817b79b67b4ba2e6c12afdd3.tar.xz
wireguard-openbsd-8036030af59dfb27817b79b67b4ba2e6c12afdd3.zip
Convert various rtrequest1(RTM_DELETE,...) calls to rtdeletemsg(9).
This unify some code and notify userland for free. blambert@ agrees, ok bluhm@
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 89de1731854..c1a1a422d0d 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.155 2015/01/28 22:10:13 mpi Exp $ */
+/* $OpenBSD: icmp6.c,v 1.156 2015/02/05 03:01:03 mpi Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1983,18 +1983,10 @@ icmp6_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
panic("icmp6_mtudisc_timeout: bad route to timeout");
if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
(RTF_DYNAMIC | RTF_HOST)) {
- struct rt_addrinfo info;
int s;
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
-
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
splx(s);
} else {
if (!(rt->rt_rmx.rmx_locks & RTV_MTU))
@@ -2009,18 +2001,10 @@ icmp6_redirect_timeout(struct rtentry *rt, struct rttimer *r)
panic("icmp6_redirect_timeout: bad route to timeout");
if ((rt->rt_flags & (RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) ==
(RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) {
- struct rt_addrinfo info;
int s;
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
-
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
splx(s);
}
}