[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.86 and 1.91

version 1.86, 2001/10/24 06:04:08 version 1.91, 2001/11/13 00:32:42
Line 64 
Line 64 
  *      @(#)udp_usrreq.c        8.6 (Berkeley) 5/23/95   *      @(#)udp_usrreq.c        8.6 (Berkeley) 5/23/95
  */   */
   
   #include <sys/cdefs.h>
   __KERNEL_RCSID(0, "$NetBSD$");
   
 #include "opt_inet.h"  #include "opt_inet.h"
 #include "opt_ipsec.h"  #include "opt_ipsec.h"
 #include "opt_inet_csum.h"  #include "opt_inet_csum.h"
Line 80 
Line 83 
 #include <sys/systm.h>  #include <sys/systm.h>
 #include <sys/proc.h>  #include <sys/proc.h>
 #include <sys/domain.h>  #include <sys/domain.h>
   
 #include <uvm/uvm_extern.h>  
 #include <sys/sysctl.h>  #include <sys/sysctl.h>
   
 #include <net/if.h>  #include <net/if.h>
Line 147  static int udp4_realinput __P((struct so
Line 148  static int udp4_realinput __P((struct so
 #ifdef INET6  #ifdef INET6
 static void udp6_sendup __P((struct mbuf *, int, struct sockaddr *,  static void udp6_sendup __P((struct mbuf *, int, struct sockaddr *,
         struct socket *));          struct socket *));
 static  int in6_mcmatch __P((struct in6pcb *, struct in6_addr *,  
         struct ifnet *));  
 static int udp6_realinput __P((int, struct sockaddr_in6 *,  static int udp6_realinput __P((int, struct sockaddr_in6 *,
         struct sockaddr_in6 *, struct mbuf *, int));          struct sockaddr_in6 *, struct mbuf *, int));
 #endif  #endif
Line 637  udp4_realinput(src, dst, m, off)
Line 636  udp4_realinput(src, dst, m, off)
                 /*                  /*
                  * Locate pcb(s) for datagram.                   * Locate pcb(s) for datagram.
                  */                   */
                 for (inp = udbtable.inpt_queue.cqh_first;                  CIRCLEQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) {
                     inp != (struct inpcb *)&udbtable.inpt_queue;  
                     inp = inp->inp_queue.cqe_next) {  
                         if (inp->inp_lport != *dport)                          if (inp->inp_lport != *dport)
                                 continue;                                  continue;
                         if (!in_nullhost(inp->inp_laddr)) {                          if (!in_nullhost(inp->inp_laddr)) {
Line 692  bad:
Line 689  bad:
   
 #ifdef INET6  #ifdef INET6
 static int  static int
 in6_mcmatch(in6p, ia6, ifp)  
         struct in6pcb *in6p;  
         struct in6_addr *ia6;  
         struct ifnet *ifp;  
 {  
         struct ip6_moptions *im6o = in6p->in6p_moptions;  
         struct in6_multi_mship *imm;  
   
         if (im6o == NULL)  
                 return 0;  
   
         for (imm = im6o->im6o_memberships.lh_first; imm != NULL;  
              imm = imm->i6mm_chain.le_next) {  
                 if ((ifp == NULL ||  
                      imm->i6mm_maddr->in6m_ifp == ifp) &&  
                     IN6_ARE_ADDR_EQUAL(&imm->i6mm_maddr->in6m_addr,  
                                        ia6))  
                         return 1;  
         }  
         return 0;  
 }  
   
 static int  
 udp6_realinput(af, src, dst, m, off)  udp6_realinput(af, src, dst, m, off)
         int af;         /* af on packet */          int af;         /* af on packet */
         struct sockaddr_in6 *src;          struct sockaddr_in6 *src;
Line 740  udp6_realinput(af, src, dst, m, off)
Line 714  udp6_realinput(af, src, dst, m, off)
         sport = src->sin6_port;          sport = src->sin6_port;
         in6_embedscope(&dst6, dst, NULL, NULL);          in6_embedscope(&dst6, dst, NULL, NULL);
         dport = dst->sin6_port;          dport = dst->sin6_port;
         dst4 = (struct in_addr *)&dst->sin6_addr.s6_addr32[12];          dst4 = (struct in_addr *)&dst->sin6_addr.s6_addr[12];
   
         if (IN6_IS_ADDR_MULTICAST(&dst6) ||          if (IN6_IS_ADDR_MULTICAST(&dst6) ||
             (af == AF_INET && IN_MULTICAST(dst4->s_addr))) {              (af == AF_INET && IN_MULTICAST(dst4->s_addr))) {
Line 773  udp6_realinput(af, src, dst, m, off)
Line 747  udp6_realinput(af, src, dst, m, off)
                         if (in6p->in6p_lport != dport)                          if (in6p->in6p_lport != dport)
                                 continue;                                  continue;
                         if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr)) {                          if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr)) {
                                 if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &dst6) &&                                  if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &dst6))
                                     !in6_mcmatch(in6p, &dst6, m->m_pkthdr.rcvif))  
                                         continue;                                          continue;
                         }                          }
                         else {                          else {

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.91

CVSweb <webmaster@jp.NetBSD.org>