version 1.158, 2016/05/12 02:24:17 |
version 1.158.2.4, 2017/04/26 02:53:29 |
Line 72 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 72 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include "opt_compat_netbsd.h" |
#include "opt_compat_netbsd.h" |
#include "opt_ipsec.h" |
#include "opt_ipsec.h" |
#include "opt_mrouting.h" |
#include "opt_mrouting.h" |
|
#include "opt_net_mpsafe.h" |
#endif |
#endif |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
Line 212 rip_input(struct mbuf *m, ...) |
|
Line 213 rip_input(struct mbuf *m, ...) |
|
#if defined(IPSEC) |
#if defined(IPSEC) |
/* check AH/ESP integrity. */ |
/* check AH/ESP integrity. */ |
else if (ipsec_used && |
else if (ipsec_used && |
ipsec4_in_reject_so(m, last->inp_socket)) { |
ipsec4_in_reject(m, last)) { |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
/* do not inject data to pcb */ |
/* do not inject data to pcb */ |
} |
} |
Line 227 rip_input(struct mbuf *m, ...) |
|
Line 228 rip_input(struct mbuf *m, ...) |
|
#if defined(IPSEC) |
#if defined(IPSEC) |
/* check AH/ESP integrity. */ |
/* check AH/ESP integrity. */ |
if (ipsec_used && last != NULL |
if (ipsec_used && last != NULL |
&& ipsec4_in_reject_so(m, last->inp_socket)) { |
&& ipsec4_in_reject(m, last)) { |
m_freem(m); |
m_freem(m); |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
IP_STATDEC(IP_STAT_DELIVERED); |
IP_STATDEC(IP_STAT_DELIVERED); |
Line 382 rip_output(struct mbuf *m, struct inpcb |
|
Line 383 rip_output(struct mbuf *m, struct inpcb |
|
* will be stored in inp_errormtu. |
* will be stored in inp_errormtu. |
*/ |
*/ |
return ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, |
return ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, |
inp->inp_socket); |
inp); |
} |
} |
|
|
/* |
/* |
Line 554 rip_bind(struct socket *so, struct socka |
|
Line 555 rip_bind(struct socket *so, struct socka |
|
struct inpcb *inp = sotoinpcb(so); |
struct inpcb *inp = sotoinpcb(so); |
struct sockaddr_in *addr = (struct sockaddr_in *)nam; |
struct sockaddr_in *addr = (struct sockaddr_in *)nam; |
int error = 0; |
int error = 0; |
int s; |
int s, ss; |
struct ifaddr *ia; |
struct ifaddr *ifa; |
|
|
KASSERT(solocked(so)); |
KASSERT(solocked(so)); |
KASSERT(inp != NULL); |
KASSERT(inp != NULL); |
Line 573 rip_bind(struct socket *so, struct socka |
|
Line 574 rip_bind(struct socket *so, struct socka |
|
error = EAFNOSUPPORT; |
error = EAFNOSUPPORT; |
goto release; |
goto release; |
} |
} |
if ((ia = ifa_ifwithaddr(sintosa(addr))) == 0 && |
ss = pserialize_read_enter(); |
|
if ((ifa = ifa_ifwithaddr(sintosa(addr))) == NULL && |
!in_nullhost(addr->sin_addr)) |
!in_nullhost(addr->sin_addr)) |
{ |
{ |
|
pserialize_read_exit(ss); |
error = EADDRNOTAVAIL; |
error = EADDRNOTAVAIL; |
goto release; |
goto release; |
} |
} |
if (ia && ((struct in_ifaddr *)ia)->ia4_flags & |
if (ifa && (ifatoia(ifa))->ia4_flags & IN6_IFF_DUPLICATED) { |
(IN6_IFF_NOTREADY | IN_IFF_DETACHED)) |
pserialize_read_exit(ss); |
{ |
|
error = EADDRNOTAVAIL; |
error = EADDRNOTAVAIL; |
goto release; |
goto release; |
} |
} |
|
pserialize_read_exit(ss); |
|
|
inp->inp_laddr = addr->sin_addr; |
inp->inp_laddr = addr->sin_addr; |
|
|
Line 804 rip_purgeif(struct socket *so, struct if |
|
Line 807 rip_purgeif(struct socket *so, struct if |
|
s = splsoftnet(); |
s = splsoftnet(); |
mutex_enter(softnet_lock); |
mutex_enter(softnet_lock); |
in_pcbpurgeif0(&rawcbtable, ifp); |
in_pcbpurgeif0(&rawcbtable, ifp); |
|
#ifdef NET_MPSAFE |
|
mutex_exit(softnet_lock); |
|
#endif |
in_purgeif(ifp); |
in_purgeif(ifp); |
|
#ifdef NET_MPSAFE |
|
mutex_enter(softnet_lock); |
|
#endif |
in_pcbpurgeif(&rawcbtable, ifp); |
in_pcbpurgeif(&rawcbtable, ifp); |
mutex_exit(softnet_lock); |
mutex_exit(softnet_lock); |
splx(s); |
splx(s); |