[BACK]Return to raw_ip.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / netinet

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/netinet/raw_ip.c between version 1.87.2.2 and 1.89

version 1.87.2.2, 2006/12/30 20:50:33 version 1.89, 2006/05/14 21:19:34
Line 506  rip_usrreq(struct socket *so, int req,
Line 506  rip_usrreq(struct socket *so, int req,
     struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l)      struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l)
 {  {
         struct inpcb *inp;          struct inpcb *inp;
           struct proc *p;
         int s;          int s;
         int error = 0;          int error = 0;
 #ifdef MROUTING  #ifdef MROUTING
         extern struct socket *ip_mrouter;          extern struct socket *ip_mrouter;
 #endif  #endif
   
           p = l ? l->l_proc : NULL;
         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, l));                      (struct ifnet *)control, p));
   
         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 543  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 = kauth_authorize_generic(p->p_cred,
                 if (l == NULL) {                                                  KAUTH_GENERIC_ISSUSER, &p->p_acflag))) {
                         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)

Legend:
Removed from v.1.87.2.2  
changed lines
  Added in v.1.89

CVSweb <webmaster@jp.NetBSD.org>