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.46.2.3 retrieving revision 1.49 diff -u -p -r1.46.2.3 -r1.49 --- src/sys/netinet/raw_ip.c 2001/03/12 13:31:51 1.46.2.3 +++ src/sys/netinet/raw_ip.c 2000/02/01 22:52:08 1.49 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.46.2.3 2001/03/12 13:31:51 bouyer Exp $ */ +/* $NetBSD: raw_ip.c,v 1.49 2000/02/01 22:52:08 thorpej Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -95,6 +95,8 @@ #include #endif /*IPSEC*/ +extern u_char ip_protox[]; +extern struct protosw inetsw[]; struct inpcbtable rawcbtable; int rip_bind __P((struct inpcb *, struct mbuf *)); @@ -138,8 +140,8 @@ rip_input(m, va_alist) #endif { int off, proto; - struct ip *ip = mtod(m, struct ip *); - struct inpcb *inp; + register struct ip *ip = mtod(m, struct ip *); + register struct inpcb *inp; struct inpcb *last = 0; struct mbuf *opts = 0; struct sockaddr_in ripsrc; @@ -175,14 +177,6 @@ rip_input(m, va_alist) continue; if (last) { struct mbuf *n; - -#ifdef IPSEC - /* check AH/ESP integrity. */ - if (ipsec4_in_reject_so(m, last->inp_socket)) { - ipsecstat.in_polvio++; - /* do not inject data to pcb */ - } else -#endif /*IPSEC*/ if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { if (last->inp_flags & INP_CONTROLOPTS || last->inp_socket->so_options & SO_TIMESTAMP) @@ -200,15 +194,6 @@ rip_input(m, va_alist) } last = inp; } -#ifdef IPSEC - /* check AH/ESP integrity. */ - if (last && ipsec4_in_reject_so(m, last->inp_socket)) { - m_freem(m); - ipsecstat.in_polvio++; - ipstat.ips_delivered--; - /* do not inject data to pcb */ - } else -#endif /*IPSEC*/ if (last) { if (last->inp_flags & INP_CONTROLOPTS || last->inp_socket->so_options & SO_TIMESTAMP) @@ -245,8 +230,8 @@ rip_output(m, va_alist) va_dcl #endif { - struct inpcb *inp; - struct ip *ip; + register struct inpcb *inp; + register struct ip *ip; struct mbuf *opts; int flags; va_list ap; @@ -296,10 +281,7 @@ rip_output(m, va_alist) ipstat.ips_rawout++; } #ifdef IPSEC - if (ipsec_setsocket(m, inp->inp_socket) != 0) { - m_freem(m); - return ENOBUFS; - } + m->m_pkthdr.rcvif = (struct ifnet *)inp->inp_socket; /*XXX*/ #endif /*IPSEC*/ return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, &inp->inp_errormtu)); } @@ -314,7 +296,7 @@ rip_ctloutput(op, so, level, optname, m) int level, optname; struct mbuf **m; { - struct inpcb *inp = sotoinpcb(so); + register struct inpcb *inp = sotoinpcb(so); int error = 0; if (level != IPPROTO_IP) { @@ -433,14 +415,14 @@ u_long rip_recvspace = RIPRCVQ; /*ARGSUSED*/ int rip_usrreq(so, req, m, nam, control, p) - struct socket *so; + register struct socket *so; int req; struct mbuf *m, *nam, *control; struct proc *p; { - struct inpcb *inp; + register struct inpcb *inp; int s; - int error = 0; + register int error = 0; #ifdef MROUTING extern struct socket *ip_mrouter; #endif @@ -449,9 +431,8 @@ rip_usrreq(so, req, m, nam, control, p) return (in_control(so, (long)m, (caddr_t)nam, (struct ifnet *)control, p)); - if (req == PRU_PURGEIF) { - in_purgeif((struct ifnet *)control); - in_pcbpurgeif(&rawcbtable, (struct ifnet *)control); + if (req == PRU_PURGEADDR) { + in_purgeaddr((struct ifaddr *)nam, (struct ifnet *)control); return (0); }