version 1.42.6.1, 1999/06/28 06:37:01 |
version 1.51, 2000/02/17 10:59:36 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
|
|
/* |
/* |
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
|
* All rights reserved. |
|
* |
|
* Redistribution and use in source and binary forms, with or without |
|
* modification, are permitted provided that the following conditions |
|
* are met: |
|
* 1. Redistributions of source code must retain the above copyright |
|
* notice, this list of conditions and the following disclaimer. |
|
* 2. Redistributions in binary form must reproduce the above copyright |
|
* notice, this list of conditions and the following disclaimer in the |
|
* documentation and/or other materials provided with the distribution. |
|
* 3. Neither the name of the project nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
|
* without specific prior written permission. |
|
* |
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND |
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE |
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
* SUCH DAMAGE. |
|
*/ |
|
|
|
/* |
* Copyright (c) 1982, 1986, 1988, 1993 |
* Copyright (c) 1982, 1986, 1988, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
* |
* |
|
|
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 |
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 |
*/ |
*/ |
|
|
|
#include "opt_ipsec.h" |
#include "opt_mrouting.h" |
#include "opt_mrouting.h" |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
|
|
#include <netinet/ip.h> |
#include <netinet/ip.h> |
#include <netinet/ip_var.h> |
#include <netinet/ip_var.h> |
#include <netinet/ip_mroute.h> |
#include <netinet/ip_mroute.h> |
|
#include <netinet/ip_icmp.h> |
#include <netinet/in_pcb.h> |
#include <netinet/in_pcb.h> |
#include <netinet/in_var.h> |
#include <netinet/in_var.h> |
|
|
Line 173 rip_input(m, va_alist) |
|
Line 204 rip_input(m, va_alist) |
|
} else |
} else |
sorwakeup(last->inp_socket); |
sorwakeup(last->inp_socket); |
} else { |
} else { |
m_freem(m); |
if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { |
ipstat.ips_noproto++; |
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL, |
ipstat.ips_delivered--; |
0, 0); |
|
ipstat.ips_noproto++; |
|
ipstat.ips_delivered--; |
|
} else |
|
m_freem(m); |
} |
} |
return; |
return; |
} |
} |
Line 394 rip_usrreq(so, req, m, nam, control, p) |
|
Line 429 rip_usrreq(so, req, m, nam, control, p) |
|
return (in_control(so, (long)m, (caddr_t)nam, |
return (in_control(so, (long)m, (caddr_t)nam, |
(struct ifnet *)control, p)); |
(struct ifnet *)control, p)); |
|
|
|
if (req == PRU_PURGEIF) { |
|
in_purgeif((struct ifnet *)control); |
|
in_pcbpurgeif(&rawcbtable, (struct ifnet *)control); |
|
return (0); |
|
} |
|
|
s = splsoftnet(); |
s = splsoftnet(); |
inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
Line 427 rip_usrreq(so, req, m, nam, control, p) |
|
Line 468 rip_usrreq(so, req, m, nam, control, p) |
|
inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
inp->inp_ip.ip_p = (long)nam; |
inp->inp_ip.ip_p = (long)nam; |
#ifdef IPSEC |
#ifdef IPSEC |
error = ipsec_init_policy(&inp->inp_sp); |
error = ipsec_init_policy(so, &inp->inp_sp); |
|
if (error != 0) { |
|
in_pcbdetach(inp); |
|
break; |
|
} |
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
break; |
break; |
|
|