diff options
author | julian <julian@FreeBSD.org> | 2001-09-03 20:03:55 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-03 20:03:55 +0000 |
commit | 071f86f9f1c961dd8169268ab4895d7ed7a350f0 (patch) | |
tree | 8d09274631c646d1bfce4acc158d08cc765103da /sys/netinet/ip_encap.c | |
parent | b278777ba611a10a308ea300780edcc62fdb7d3d (diff) | |
download | FreeBSD-src-071f86f9f1c961dd8169268ab4895d7ed7a350f0.zip FreeBSD-src-071f86f9f1c961dd8169268ab4895d7ed7a350f0.tar.gz |
Patches from Keiichi SHIMA <keiichi@iij.ad.jp>
to make ip use the standard protosw structure again.
Obtained from: Well, KAME I guess.
Diffstat (limited to 'sys/netinet/ip_encap.c')
-rw-r--r-- | sys/netinet/ip_encap.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/netinet/ip_encap.c b/sys/netinet/ip_encap.c index f5263cb..2caeeac 100644 --- a/sys/netinet/ip_encap.c +++ b/sys/netinet/ip_encap.c @@ -77,7 +77,6 @@ #include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/ip_encap.h> -#include <netinet/ipprotosw.h> #ifdef INET6 #include <netinet/ip6.h> @@ -138,17 +137,17 @@ encap4_input(m, va_alist) int off, proto; struct ip *ip; struct sockaddr_in s, d; - const struct ipprotosw *psw; + const struct protosw *psw; struct encaptab *ep, *match; va_list ap; int prio, matchprio; va_start(ap, m); off = va_arg(ap, int); - proto = va_arg(ap, int); va_end(ap); ip = mtod(m, struct ip *); + proto = ip->ip_p; bzero(&s, sizeof(s)); s.sin_family = AF_INET; @@ -205,17 +204,23 @@ encap4_input(m, va_alist) if (match) { /* found a match, "match" has the best one */ - psw = (const struct ipprotosw *)match->psw; + psw = match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); - (*psw->pr_input)(m, off, proto); + (*psw->pr_input)(m, off); } else m_freem(m); return; } + /* for backward compatibility - messy... */ + if (proto == IPPROTO_IPV4) { + ipip_input(m, off); + return; + } + /* last resort: inject to raw socket */ - rip_input(m, off, proto); + rip_input(m, off); } #endif |