summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-01 21:40:40 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-01 21:40:40 +0000
commit5253d59489b771872b9901a35e753887ebbd5095 (patch)
tree9fc9f066533041fb6d0daed126f4734e6a52008b /sys/netinet
parenta5f79d90ac87d61dd3b65edfd8892b4192d33de5 (diff)
Rename rtalloc1() into rtalloc(9) and convert its flags to only enable
functionnality instead of a mix of enable/disable. ok bluhm@, jca@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c9
-rw-r--r--sys/netinet/ip_icmp.c8
-rw-r--r--sys/netinet/ip_input.c8
-rw-r--r--sys/netinet/ip_output.c9
-rw-r--r--sys/netinet/ip_spd.c6
5 files changed, 22 insertions, 18 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 31a02254fd0..74411813623 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.136 2014/09/03 08:53:54 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.137 2014/11/01 21:40:38 mpi Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -366,7 +366,7 @@ arpresolve(struct arpcom *ac, struct rtentry *rt, struct mbuf *m,
"local address\n", inet_ntop(AF_INET,
&satosin(dst)->sin_addr, addr, sizeof(addr)));
} else {
- if ((la = arplookup(satosin(dst)->sin_addr.s_addr, RT_REPORT, 0,
+ if ((la = arplookup(satosin(dst)->sin_addr.s_addr, 1, 0,
ac->ac_if.if_rdomain)) != NULL)
rt = la->la_rt;
else
@@ -801,13 +801,16 @@ arplookup(u_int32_t addr, int create, int proxy, u_int tableid)
{
struct rtentry *rt;
struct sockaddr_inarp sin;
+ int flags;
memset(&sin, 0, sizeof(sin));
sin.sin_len = sizeof(sin);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = addr;
sin.sin_other = proxy ? SIN_PROXY : 0;
- rt = rtalloc1((struct sockaddr *)&sin, create, tableid);
+ flags = (create) ? (RT_REPORT|RT_RESOLVE) : 0;
+
+ rt = rtalloc((struct sockaddr *)&sin, flags, tableid);
if (rt == 0)
return (0);
rt->rt_refcnt--;
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 797b6d6ca32..79b1a12ddb0 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.125 2014/09/30 08:26:15 mpi Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.126 2014/11/01 21:40:38 mpi Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -715,7 +715,7 @@ icmp_reflect(struct mbuf *m, struct mbuf **op, struct in_ifaddr *ia)
sin.sin_family = AF_INET;
sin.sin_addr = ip->ip_dst;
- rt = rtalloc1(sintosa(&sin), 0, rtableid);
+ rt = rtalloc(sintosa(&sin), 0, rtableid);
if (rt != NULL) {
if (rt->rt_flags & (RTF_LOCAL|RTF_BROADCAST))
ia = ifatoia(rt->rt_ifa);
@@ -735,7 +735,7 @@ icmp_reflect(struct mbuf *m, struct mbuf **op, struct in_ifaddr *ia)
sin.sin_addr = ip->ip_src;
/* keep packet in the original virtual instance */
- rt = rtalloc1(sintosa(&sin), RT_REPORT, rtableid);
+ rt = rtalloc(sintosa(&sin), RT_REPORT|RT_RESOLVE, rtableid);
if (rt == NULL) {
ipstat.ips_noroute++;
m_freem(m);
@@ -924,7 +924,7 @@ icmp_mtudisc_clone(struct in_addr dst, u_int rtableid)
sin->sin_len = sizeof(*sin);
sin->sin_addr = dst;
- rt = rtalloc1(&ro.ro_dst, RT_REPORT, rtableid);
+ rt = rtalloc(&ro.ro_dst, RT_REPORT|RT_RESOLVE, rtableid);
if (rt == NULL)
return (NULL);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 3324b736687..63496171a1b 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.238 2014/10/14 09:52:26 mpi Exp $ */
+/* $OpenBSD: ip_input.c,v 1.239 2014/11/01 21:40:38 mpi Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -667,7 +667,7 @@ in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct in_addr ina)
sin.sin_len = sizeof(sin);
sin.sin_family = AF_INET;
sin.sin_addr = ina;
- rt = rtalloc1(sintosa(&sin), 0, m->m_pkthdr.ph_rtableid);
+ rt = rtalloc(sintosa(&sin), 0, m->m_pkthdr.ph_rtableid);
if (rt != NULL) {
if (rt->rt_flags & (RTF_LOCAL|RTF_BROADCAST))
ia = ifatoia(rt->rt_ifa);
@@ -1251,8 +1251,8 @@ ip_rtaddr(struct in_addr dst, u_int rtableid)
sin->sin_len = sizeof(*sin);
sin->sin_addr = dst;
- ipforward_rt.ro_rt = rtalloc1(&ipforward_rt.ro_dst, RT_REPORT,
- rtableid);
+ ipforward_rt.ro_rt = rtalloc(&ipforward_rt.ro_dst,
+ RT_REPORT|RT_RESOLVE, rtableid);
}
if (ipforward_rt.ro_rt == 0)
return (NULL);
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 8fd2a91f27a..9e36e6a8743 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.269 2014/10/14 09:52:26 mpi Exp $ */
+/* $OpenBSD: ip_output.c,v 1.270 2014/11/01 21:40:38 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -583,7 +583,8 @@ sendit:
rt->rt_rmx.rmx_mtu = icmp_mtu;
if (ro && ro->ro_rt != NULL) {
rtfree(ro->ro_rt);
- ro->ro_rt = rtalloc1(&ro->ro_dst, RT_REPORT,
+ ro->ro_rt = rtalloc(&ro->ro_dst,
+ RT_REPORT|RT_RESOLVE,
m->m_pkthdr.ph_rtableid);
}
if (rt_mtucloned)
@@ -1771,8 +1772,8 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m,
dst->sin_addr = mreq->imr_multiaddr;
if (!(ro.ro_rt && ro.ro_rt->rt_ifp &&
(ro.ro_rt->rt_flags & RTF_UP)))
- ro.ro_rt = rtalloc1(&ro.ro_dst, RT_REPORT,
- rtableid);
+ ro.ro_rt = rtalloc(&ro.ro_dst,
+ RT_REPORT|RT_RESOLVE, rtableid);
if (ro.ro_rt == NULL) {
error = EADDRNOTAVAIL;
break;
diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c
index b35a20350d1..455895cfb07 100644
--- a/sys/netinet/ip_spd.c
+++ b/sys/netinet/ip_spd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_spd.c,v 1.74 2014/10/14 09:52:26 mpi Exp $ */
+/* $OpenBSD: ip_spd.c,v 1.75 2014/11/01 21:40:39 mpi Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -244,8 +244,8 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int *error, int direction,
re->re_tableid = rdomain;
/* Actual SPD lookup. */
- re->re_rt = rtalloc1((struct sockaddr *)&re->re_dst, RT_REPORT,
- re->re_tableid);
+ re->re_rt = rtalloc((struct sockaddr *)&re->re_dst,
+ RT_REPORT|RT_RESOLVE, re->re_tableid);
if (re->re_rt == NULL) {
/*
* Return whatever the socket requirements are, there are no