summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-28 22:10:14 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-28 22:10:14 +0000
commit7a157721340fa50018047d038aa566533be205a5 (patch)
treeff2dfc10d903da49e3b9efdaac2ebdbfba326c53 /sys/netinet
parentabf2bc1fa71cdc7bb8d08dcd39910a1896ed0d38 (diff)
Revert rtdeletemsg conversion. It was not ok'd, I misunderstood bluhm@'s
email.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c11
-rw-r--r--sys/netinet/ip_icmp.c22
2 files changed, 21 insertions, 12 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 6ff4877f1cc..5b4630dd808 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.142 2015/01/26 11:36:38 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.143 2015/01/28 22:10:13 mpi Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -789,7 +789,6 @@ arptfree(struct llinfo_arp *la)
struct rtentry *rt = la->la_rt;
struct sockaddr_dl *sdl;
u_int tid = 0;
- int error;
if (rt == NULL)
panic("arptfree");
@@ -804,13 +803,7 @@ arptfree(struct llinfo_arp *la)
if (rt->rt_ifp)
tid = rt->rt_ifp->if_rdomain;
- error = rtdeletemsg(rt, tid);
-
- /* Adjust the refcount */
- if (error == 0 && rt->rt_refcnt <= 0) {
- rt->rt_refcnt++;
- rtfree(rt);
- }
+ rtdeletemsg(rt, tid);
}
/*
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index e34b98ffc34..ac27df55014 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.130 2015/01/26 11:38:37 mpi Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.131 2015/01/28 22:10:13 mpi Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -1031,12 +1031,20 @@ icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
(RTF_DYNAMIC | RTF_HOST)) {
void *(*ctlfunc)(int, struct sockaddr *, u_int, void *);
struct sockaddr_in sa;
+ struct rt_addrinfo info;
int s;
+ memset(&info, 0, sizeof(info));
+ info.rti_info[RTAX_DST] = rt_key(rt);
+ info.rti_info[RTAX_NETMASK] = rt_mask(rt);
+ info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+ info.rti_flags = rt->rt_flags;
+
sa = *(struct sockaddr_in *)rt_key(rt);
s = splsoftnet();
- rtdeletemsg(rt, r->rtt_tableid);
+ rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
+ r->rtt_tableid);
/* Notify TCP layer of increased Path MTU estimate */
ctlfunc = inetsw[ip_protox[IPPROTO_TCP]].pr_ctlinput;
@@ -1075,10 +1083,18 @@ icmp_redirect_timeout(struct rtentry *rt, struct rttimer *r)
if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
(RTF_DYNAMIC | RTF_HOST)) {
+ struct rt_addrinfo info;
int s;
+ memset(&info, 0, sizeof(info));
+ info.rti_info[RTAX_DST] = rt_key(rt);
+ info.rti_info[RTAX_NETMASK] = rt_mask(rt);
+ info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+ info.rti_flags = rt->rt_flags;
+
s = splsoftnet();
- rtdeletemsg(rt, r->rtt_tableid);
+ rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
+ r->rtt_tableid);
splx(s);
}
}