Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/raw_ip.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/raw_ip.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.73 retrieving revision 1.80 diff -u -p -r1.73 -r1.80 --- src/sys/netinet/raw_ip.c 2003/08/22 21:53:05 1.73 +++ src/sys/netinet/raw_ip.c 2004/05/07 00:55:15 1.80 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.73 2003/08/22 21:53:05 itojun Exp $ */ +/* $NetBSD: raw_ip.c,v 1.80 2004/05/07 00:55:15 jonathan Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,8 +61,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.73 2003/08/22 21:53:05 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.80 2004/05/07 00:55:15 jonathan Exp $"); +#include "opt_inet.h" #include "opt_ipsec.h" #include "opt_mrouting.h" @@ -96,6 +97,7 @@ __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1 #ifdef FAST_IPSEC #include +#include /* XXX ipsecstat namespace */ #endif /* FAST_IPSEC*/ struct inpcbtable rawcbtable; @@ -132,16 +134,11 @@ rip_init() * mbuf chain. */ void -#if __STDC__ rip_input(struct mbuf *m, ...) -#else -rip_input(m, va_alist) - struct mbuf *m; - va_dcl -#endif { int proto; struct ip *ip = mtod(m, struct ip *); + struct inpcb_hdr *inph; struct inpcb *inp; struct inpcb *last = 0; struct mbuf *opts = 0; @@ -167,7 +164,10 @@ rip_input(m, va_alist) ip->ip_len = ntohs(ip->ip_len) - (ip->ip_hl << 2); NTOHS(ip->ip_off); - CIRCLEQ_FOREACH(inp, &rawcbtable.inpt_queue, inp_queue) { + CIRCLEQ_FOREACH(inph, &rawcbtable.inpt_queue, inph_queue) { + inp = (struct inpcb *)inph; + if (inp->inp_af != AF_INET) + continue; if (inp->inp_ip.ip_p && inp->inp_ip.ip_p != proto) continue; if (!in_nullhost(inp->inp_laddr) && @@ -247,10 +247,12 @@ rip_pcbnotify(table, faddr, laddr, proto int nmatch; nmatch = 0; - for (inp = CIRCLEQ_FIRST(&table->inpt_queue); + for (inp = (struct inpcb *)CIRCLEQ_FIRST(&table->inpt_queue); inp != (struct inpcb *)&table->inpt_queue; inp = ninp) { - ninp = inp->inp_queue.cqe_next; + ninp = (struct inpcb *)inp->inp_queue.cqe_next; + if (inp->inp_af != AF_INET) + continue; if (inp->inp_ip.ip_p && inp->inp_ip.ip_p != proto) continue; if (in_hosteq(inp->inp_faddr, faddr) && @@ -301,13 +303,7 @@ rip_ctlinput(cmd, sa, v) * Tack on options user may have setup with control call. */ int -#if __STDC__ rip_output(struct mbuf *m, ...) -#else -rip_output(m, va_alist) - struct mbuf *m; - va_dcl -#endif { struct inpcb *inp; struct ip *ip; @@ -373,18 +369,12 @@ rip_output(m, va_alist) HTONS(ip->ip_len); HTONS(ip->ip_off); if (ip->ip_id == 0) - ip->ip_id = htons(ip_id++); + ip->ip_id = ip_newid(); opts = NULL; /* XXX prevent ip_output from overwriting header fields */ flags |= IP_RAWOUTPUT; ipstat.ips_rawout++; } -#ifdef IPSEC - if (ipsec_setsocket(m, inp->inp_socket) != 0) { - m_freem(m); - return ENOBUFS; - } -#endif /*IPSEC*/ return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, inp->inp_socket, &inp->inp_errormtu)); }