summaryrefslogtreecommitdiff
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 192837e6900..62604db81b6 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.182 2015/12/03 21:11:53 sashan Exp $ */
+/* $OpenBSD: icmp6.c,v 1.183 2015/12/09 09:27:40 mpi Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1952,34 +1952,42 @@ icmp6_mtudisc_clone(struct sockaddr *dst, u_int rdomain)
void
icmp6_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
{
- if (rt == NULL)
- panic("icmp6_mtudisc_timeout: bad route to timeout");
- if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
- (RTF_DYNAMIC | RTF_HOST)) {
- int s;
+ struct ifnet *ifp;
+ int s;
+ ifp = if_get(rt->rt_ifidx);
+ if (ifp == NULL)
+ return;
+
+ if ((rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == (RTF_DYNAMIC|RTF_HOST)) {
s = splsoftnet();
- rtdeletemsg(rt, NULL, r->rtt_tableid);
+ rtdeletemsg(rt, ifp, r->rtt_tableid);
splx(s);
} else {
if (!(rt->rt_rmx.rmx_locks & RTV_MTU))
rt->rt_rmx.rmx_mtu = 0;
}
+
+ if_put(ifp);
}
void
icmp6_redirect_timeout(struct rtentry *rt, struct rttimer *r)
{
- if (rt == NULL)
- panic("icmp6_redirect_timeout: bad route to timeout");
- if ((rt->rt_flags & (RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) ==
- (RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) {
- int s;
+ struct ifnet *ifp;
+ int s;
+ ifp = if_get(rt->rt_ifidx);
+ if (ifp == NULL)
+ return;
+
+ if ((rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == (RTF_DYNAMIC|RTF_HOST)) {
s = splsoftnet();
- rtdeletemsg(rt, NULL, r->rtt_tableid);
+ rtdeletemsg(rt, ifp, r->rtt_tableid);
splx(s);
}
+
+ if_put(ifp);
}
int *icmpv6ctl_vars[ICMPV6CTL_MAXID] = ICMPV6CTL_VARS;