version 1.81.6.2, 2005/03/19 08:36:38 |
version 1.94, 2006/10/25 22:49:23 |
Line 77 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 77 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/errno.h> |
#include <sys/errno.h> |
#include <sys/systm.h> |
#include <sys/systm.h> |
#include <sys/proc.h> |
#include <sys/proc.h> |
|
#include <sys/kauth.h> |
|
|
#include <net/if.h> |
#include <net/if.h> |
#include <net/route.h> |
#include <net/route.h> |
Line 88 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 89 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <netinet/ip_mroute.h> |
#include <netinet/ip_mroute.h> |
#include <netinet/ip_icmp.h> |
#include <netinet/ip_icmp.h> |
#include <netinet/in_pcb.h> |
#include <netinet/in_pcb.h> |
|
#include <netinet/in_proto.h> |
#include <netinet/in_var.h> |
#include <netinet/in_var.h> |
|
|
#include <machine/stdarg.h> |
#include <machine/stdarg.h> |
Line 501 u_long rip_recvspace = RIPRCVQ; |
|
Line 503 u_long rip_recvspace = RIPRCVQ; |
|
/*ARGSUSED*/ |
/*ARGSUSED*/ |
int |
int |
rip_usrreq(struct socket *so, int req, |
rip_usrreq(struct socket *so, int req, |
struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct proc *p) |
struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l) |
{ |
{ |
struct inpcb *inp; |
struct inpcb *inp; |
int s; |
int s; |
Line 512 rip_usrreq(struct socket *so, int req, |
|
Line 514 rip_usrreq(struct socket *so, int req, |
|
|
|
if (req == PRU_CONTROL) |
if (req == PRU_CONTROL) |
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, l)); |
|
|
|
s = splsoftnet(); |
|
|
if (req == PRU_PURGEIF) { |
if (req == PRU_PURGEIF) { |
in_pcbpurgeif0(&rawcbtable, (struct ifnet *)control); |
in_pcbpurgeif0(&rawcbtable, (struct ifnet *)control); |
in_purgeif((struct ifnet *)control); |
in_purgeif((struct ifnet *)control); |
in_pcbpurgeif(&rawcbtable, (struct ifnet *)control); |
in_pcbpurgeif(&rawcbtable, (struct ifnet *)control); |
|
splx(s); |
return (0); |
return (0); |
} |
} |
|
|
s = splsoftnet(); |
|
inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
if (req != PRU_SEND && req != PRU_SENDOOB && control) |
if (req != PRU_SEND && req != PRU_SENDOOB && control) |
Line 539 rip_usrreq(struct socket *so, int req, |
|
Line 543 rip_usrreq(struct socket *so, int req, |
|
error = EISCONN; |
error = EISCONN; |
break; |
break; |
} |
} |
if (p == 0 || (error = suser(p->p_ucred, &p->p_acflag))) { |
|
|
if (l == NULL) { |
error = EACCES; |
error = EACCES; |
break; |
break; |
} |
} |
|
|
|
/* XXX: raw socket permissions are checked in socreate() */ |
|
|
if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { |
if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { |
error = soreserve(so, rip_sendspace, rip_recvspace); |
error = soreserve(so, rip_sendspace, rip_recvspace); |
if (error) |
if (error) |