[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.52.8.1 and 1.57

version 1.52.8.1, 1999/12/27 18:36:21 version 1.57, 2000/01/31 10:39:26
Line 155  udp_init()
Line 155  udp_init()
         in_pcbinit(&udbtable, udbhashsize, udbhashsize);          in_pcbinit(&udbtable, udbhashsize, udbhashsize);
 }  }
   
   #ifndef UDP6
 void  void
 #if __STDC__  #if __STDC__
 udp_input(struct mbuf *m, ...)  udp_input(struct mbuf *m, ...)
Line 218  udp_input(m, va_alist)
Line 219  udp_input(m, va_alist)
         }          }
 #endif  #endif
   
           /* destination port of 0 is illegal, based on RFC768. */
           if (uh->uh_dport == 0)
                   goto bad;
   
         /*          /*
          * Make mbuf data length reflect UDP length.           * Make mbuf data length reflect UDP length.
          * If not enough data to reflect UDP length, drop.           * If not enough data to reflect UDP length, drop.
Line 375  udp6_input(mp, offp, proto)
Line 380  udp6_input(mp, offp, proto)
                 goto bad;                  goto bad;
         }          }
   
           /* destination port of 0 is illegal, based on RFC768. */
           if (uh->uh_dport == 0)
                   goto bad;
   
           /* Be proactive about malicious use of IPv4 mapped address */
           if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
               IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
                   /* XXX stat */
                   goto bad;
           }
   
         /*          /*
          * Checksum extended UDP header and data.           * Checksum extended UDP header and data.
          */           */
Line 758  udp6_realinput(af, src, dst, m, off)
Line 774  udp6_realinput(af, src, dst, m, off)
                                  && !in6_mcmatch(in6p, dst6, m->m_pkthdr.rcvif))                                   && !in6_mcmatch(in6p, dst6, m->m_pkthdr.rcvif))
                                         continue;                                          continue;
                         }                          }
   #ifndef INET6_BINDV6ONLY
                           else {
                                   if (IN6_IS_ADDR_V4MAPPED(dst6)
                                    && (in6p->in6p_flags & IN6P_BINDV6ONLY))
                                           continue;
                           }
   #endif
                         if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) {                          if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) {
                                 if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, src6)                                  if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, src6)
                                  || in6p->in6p_fport != *sport)                                   || in6p->in6p_fport != *sport)
                                         continue;                                          continue;
                         }                          }
   #ifndef INET6_BINDV6ONLY
                           else {
                                   if (IN6_IS_ADDR_V4MAPPED(src6)
                                    && (in6p->in6p_flags & IN6P_BINDV6ONLY))
                                           continue;
                           }
   #endif
   
                         last = in6p;                          last = in6p;
                         udp6_sendup(m, off, (struct sockaddr *)src,                          udp6_sendup(m, off, (struct sockaddr *)src,
Line 852  bad:
Line 882  bad:
 }  }
 #endif  #endif
   
 #if 0  #else /*UDP6*/
   
 void  void
 #if __STDC__  #if __STDC__
 udp_input(struct mbuf *m, ...)  udp_input(struct mbuf *m, ...)
Line 905  udp_input(m, va_alist)
Line 936  udp_input(m, va_alist)
         }          }
         uh = (struct udphdr *)((caddr_t)ip + iphlen);          uh = (struct udphdr *)((caddr_t)ip + iphlen);
   
           /* destination port of 0 is illegal, based on RFC768. */
           if (uh->uh_dport == 0)
                   goto bad;
   
         /*          /*
          * Make mbuf data length reflect UDP length.           * Make mbuf data length reflect UDP length.
          * If not enough data to reflect UDP length, drop.           * If not enough data to reflect UDP length, drop.
Line 1123  bad:
Line 1158  bad:
         if (opts)          if (opts)
                 m_freem(opts);                  m_freem(opts);
 }  }
 #endif  #endif /*UDP6*/
   
 /*  /*
  * Notify a udp user of an asynchronous error;   * Notify a udp user of an asynchronous error;

Legend:
Removed from v.1.52.8.1  
changed lines
  Added in v.1.57

CVSweb <webmaster@jp.NetBSD.org>