summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-05-07 13:33:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-05-07 13:33:18 +0000
commit043b0fc8cb63b379ff2757ab2d64bf2b4c8c2cb7 (patch)
tree18ea5d2f321a9a8ea43ecdd326acada9de6ae943 /sys/netinet/ip_input.c
parent6bcd6fa8c9cab428fd9f7d850e1771ff3f94d451 (diff)
Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1
accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 5966fdd6596..999265cf042 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.178 2010/04/20 22:05:43 tedu Exp $ */
+/* $OpenBSD: ip_input.c,v 1.179 2010/05/07 13:33:17 claudio Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -224,7 +224,6 @@ ip_init()
struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
struct route ipforward_rt;
-u_int ipforward_rtableid;
void
ipintr()
@@ -1213,7 +1212,7 @@ 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, 1,
+ ipforward_rt.ro_rt = rtalloc1(&ipforward_rt.ro_dst, RT_REPORT,
rtableid);
}
if (ipforward_rt.ro_rt == 0)
@@ -1444,7 +1443,7 @@ ip_forward(m, srcrt)
sin = satosin(&ipforward_rt.ro_dst);
if ((rt = ipforward_rt.ro_rt) == 0 ||
ip->ip_dst.s_addr != sin->sin_addr.s_addr ||
- rtableid != ipforward_rtableid) {
+ rtableid != ipforward_rt.ro_tableid) {
if (ipforward_rt.ro_rt) {
RTFREE(ipforward_rt.ro_rt);
ipforward_rt.ro_rt = 0;
@@ -1452,13 +1451,13 @@ ip_forward(m, srcrt)
sin->sin_family = AF_INET;
sin->sin_len = sizeof(*sin);
sin->sin_addr = ip->ip_dst;
+ ipforward_rt.ro_tableid = rtableid;
- rtalloc_mpath(&ipforward_rt, &ip->ip_src.s_addr, rtableid);
+ rtalloc_mpath(&ipforward_rt, &ip->ip_src.s_addr);
if (ipforward_rt.ro_rt == 0) {
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
return;
}
- ipforward_rtableid = rtableid;
rt = ipforward_rt.ro_rt;
}