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_input.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_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index d2f14da..4da9103 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -75,8 +75,6 @@ #include <netinet/ip_icmp.h> #include <machine/in_cksum.h> -#include <netinet/ipprotosw.h> - #include <sys/socketvar.h> #include <netinet/ip_fw.h> @@ -153,7 +151,7 @@ static int ipprintfs = 0; #endif extern struct domain inetdomain; -extern struct ipprotosw inetsw[]; +extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; static int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddrhead in_ifaddrhead; /* first inet address */ @@ -236,17 +234,17 @@ static void ipintr __P((void)); void ip_init() { - register struct ipprotosw *pr; + register struct protosw *pr; register int i; TAILQ_INIT(&in_ifaddrhead); - pr = (struct ipprotosw *)pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); + pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == 0) panic("ip_init"); for (i = 0; i < IPPROTO_MAX; i++) ip_protox[i] = pr - inetsw; - for (pr = (struct ipprotosw *)inetdomain.dom_protosw; - pr < (struct ipprotosw *)inetdomain.dom_protoswNPROTOSW; pr++) + for (pr = inetdomain.dom_protosw; + pr < inetdomain.dom_protoswNPROTOSW; pr++) if (pr->pr_domain->dom_family == PF_INET && pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) ip_protox[pr->pr_protocol] = pr - inetsw; @@ -819,9 +817,9 @@ found: */ ipstat.ips_delivered++; { - int off = hlen, nh = ip->ip_p; + int off = hlen; - (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, off, nh); + (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, off); #ifdef IPFIREWALL_FORWARD ip_fw_fwd_addr = NULL; /* tcp needed it */ #endif |