[BACK]Return to udp_usrreq.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/udp_usrreq.c between version 1.138.2.2 and 1.158

version 1.138.2.2, 2006/12/30 20:50:34 version 1.158, 2007/03/04 06:03:22
Line 963  udp_notify(struct inpcb *inp, int errno)
Line 963  udp_notify(struct inpcb *inp, int errno)
 }  }
   
 void *  void *
 udp_ctlinput(int cmd, struct sockaddr *sa, void *v)  udp_ctlinput(int cmd, const struct sockaddr *sa, void *v)
 {  {
         struct ip *ip = v;          struct ip *ip = v;
         struct udphdr *uh;          struct udphdr *uh;
Line 983  udp_ctlinput(int cmd, struct sockaddr *s
Line 983  udp_ctlinput(int cmd, struct sockaddr *s
         else if (errno == 0)          else if (errno == 0)
                 return NULL;                  return NULL;
         if (ip) {          if (ip) {
                 uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));                  uh = (struct udphdr *)((char *)ip + (ip->ip_hl << 2));
                 in_pcbnotify(&udbtable, satosin(sa)->sin_addr, uh->uh_dport,                  in_pcbnotify(&udbtable, satocsin(sa)->sin_addr, uh->uh_dport,
                     ip->ip_src, uh->uh_sport, errno, notify);                      ip->ip_src, uh->uh_sport, errno, notify);
   
                 /* XXX mapped address case */                  /* XXX mapped address case */
         } else          } else
                 in_pcbnotifyall(&udbtable, satosin(sa)->sin_addr, errno,                  in_pcbnotifyall(&udbtable, satocsin(sa)->sin_addr, errno,
                     notify);                      notify);
         return NULL;          return NULL;
 }  }
Line 1175  udp_usrreq(struct socket *so, int req, s
Line 1175  udp_usrreq(struct socket *so, int req, s
         int error = 0;          int error = 0;
   
         if (req == PRU_CONTROL)          if (req == PRU_CONTROL)
                 return (in_control(so, (long)m, (caddr_t)nam,                  return (in_control(so, (long)m, (void *)nam,
                     (struct ifnet *)control, l));                      (struct ifnet *)control, l));
   
         s = splsoftnet();          s = splsoftnet();
Line 1417  udp4_espinudp(struct mbuf **mp, int off,
Line 1417  udp4_espinudp(struct mbuf **mp, int off,
     struct socket *so)      struct socket *so)
 {  {
         size_t len;          size_t len;
         caddr_t data;          void *data;
         struct inpcb *inp;          struct inpcb *inp;
         size_t skip = 0;          size_t skip = 0;
         size_t minlen;          size_t minlen;
Line 1446  udp4_espinudp(struct mbuf **mp, int off,
Line 1446  udp4_espinudp(struct mbuf **mp, int off,
         }          }
   
         len = m->m_len - off;          len = m->m_len - off;
         data = mtod(m, caddr_t) + off;          data = mtod(m, char *) + off;
         inp = sotoinpcb(so);          inp = sotoinpcb(so);
   
         /* Ignore keepalive packets */          /* Ignore keepalive packets */
         if ((len == 1) && (data[0] == '\xff')) {          if ((len == 1) && (*(unsigned char *)data == 0xff)) {
                 return 1;                  return 1;
         }          }
   
Line 1482  udp4_espinudp(struct mbuf **mp, int off,
Line 1482  udp4_espinudp(struct mbuf **mp, int off,
          * Get the UDP ports. They are handled in network           * Get the UDP ports. They are handled in network
          * order everywhere in IPSEC_NAT_T code.           * order everywhere in IPSEC_NAT_T code.
          */           */
         udphdr = (struct udphdr *)(data - skip);          udphdr = (struct udphdr *)((char *)data - skip);
         sport = udphdr->uh_sport;          sport = udphdr->uh_sport;
         dport = udphdr->uh_dport;          dport = udphdr->uh_dport;
   
Line 1502  udp4_espinudp(struct mbuf **mp, int off,
Line 1502  udp4_espinudp(struct mbuf **mp, int off,
          *   <-skip->           *   <-skip->
          */           */
         iphdrlen = off - sizeof(struct udphdr);          iphdrlen = off - sizeof(struct udphdr);
         memmove(mtod(m, caddr_t) + skip, mtod(m, caddr_t), iphdrlen);          memmove(mtod(m, char *) + skip, mtod(m, void *), iphdrlen);
         m_adj(m, skip);          m_adj(m, skip);
   
         ip = mtod(m, struct ip *);          ip = mtod(m, struct ip *);

Legend:
Removed from v.1.138.2.2  
changed lines
  Added in v.1.158

CVSweb <webmaster@jp.NetBSD.org>