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

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

Diff for /src/sys/net/if_tap.c between version 1.42.2.4 and 1.42.2.5

version 1.42.2.4, 2009/09/16 13:38:01 version 1.42.2.5, 2010/03/11 15:04:27
Line 36 
Line 36 
 __KERNEL_RCSID(0, "$NetBSD$");  __KERNEL_RCSID(0, "$NetBSD$");
   
 #if defined(_KERNEL_OPT)  #if defined(_KERNEL_OPT)
 #include "bpfilter.h"  
 #include "opt_modular.h"  #include "opt_modular.h"
 #include "opt_compat_netbsd.h"  #include "opt_compat_netbsd.h"
 #endif  #endif
Line 68  __KERNEL_RCSID(0, "$NetBSD$");
Line 68  __KERNEL_RCSID(0, "$NetBSD$");
 #include <net/if_ether.h>  #include <net/if_ether.h>
 #include <net/if_media.h>  #include <net/if_media.h>
 #include <net/if_tap.h>  #include <net/if_tap.h>
 #if NBPFILTER > 0  
 #include <net/bpf.h>  #include <net/bpf.h>
 #endif  
   
 #include <compat/sys/sockio.h>  #include <compat/sys/sockio.h>
   
Line 161  static const struct fileops tap_fileops 
Line 159  static const struct fileops tap_fileops 
         .fo_stat = tap_fops_stat,          .fo_stat = tap_fops_stat,
         .fo_close = tap_fops_close,          .fo_close = tap_fops_close,
         .fo_kqfilter = tap_fops_kqfilter,          .fo_kqfilter = tap_fops_kqfilter,
         .fo_drain = fnullop_drain,          .fo_restart = fnullop_restart,
 };  };
   
 /* Helper for cloning open() */  /* Helper for cloning open() */
Line 483  tap_start(struct ifnet *ifp)
Line 481  tap_start(struct ifnet *ifp)
                                 return;                                  return;
   
                         ifp->if_opackets++;                          ifp->if_opackets++;
 #if NBPFILTER > 0  
                         if (ifp->if_bpf)                          if (ifp->if_bpf)
                                 bpf_mtap(ifp->if_bpf, m0);                                  bpf_ops->bpf_mtap(ifp->if_bpf, m0);
 #endif  
   
                         m_freem(m0);                          m_freem(m0);
                 }                  }
Line 855  tap_dev_close(struct tap_softc *sc)
Line 851  tap_dev_close(struct tap_softc *sc)
                                 break;                                  break;
   
                         ifp->if_opackets++;                          ifp->if_opackets++;
 #if NBPFILTER > 0  
                         if (ifp->if_bpf)                          if (ifp->if_bpf)
                                 bpf_mtap(ifp->if_bpf, m);                                  bpf_ops->bpf_mtap(ifp->if_bpf, m);
 #endif                          m_freem(m);
                 }                  }
         }          }
         splx(s);          splx(s);
Line 951  tap_dev_read(int unit, struct uio *uio, 
Line 946  tap_dev_read(int unit, struct uio *uio, 
         }          }
   
         ifp->if_opackets++;          ifp->if_opackets++;
 #if NBPFILTER > 0  
         if (ifp->if_bpf)          if (ifp->if_bpf)
                 bpf_mtap(ifp->if_bpf, m);                  bpf_ops->bpf_mtap(ifp->if_bpf, m);
 #endif  
   
         /*          /*
          * One read is one packet.           * One read is one packet.
Line 1065  tap_dev_write(int unit, struct uio *uio,
Line 1058  tap_dev_write(int unit, struct uio *uio,
         ifp->if_ipackets++;          ifp->if_ipackets++;
         m->m_pkthdr.rcvif = ifp;          m->m_pkthdr.rcvif = ifp;
   
 #if NBPFILTER > 0  
         if (ifp->if_bpf)          if (ifp->if_bpf)
                 bpf_mtap(ifp->if_bpf, m);                  bpf_ops->bpf_mtap(ifp->if_bpf, m);
 #endif  
         s =splnet();          s =splnet();
         (*ifp->if_input)(ifp, m);          (*ifp->if_input)(ifp, m);
         splx(s);          splx(s);

Legend:
Removed from v.1.42.2.4  
changed lines
  Added in v.1.42.2.5

CVSweb <webmaster@jp.NetBSD.org>