[BACK]Return to if_ethersubr.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_ethersubr.c between version 1.132 and 1.133

version 1.132, 2006/05/14 21:19:33 version 1.133, 2006/05/18 09:05:51
Line 151  __KERNEL_RCSID(0, "$NetBSD$");
Line 151  __KERNEL_RCSID(0, "$NetBSD$");
 #include <netns/ns_if.h>  #include <netns/ns_if.h>
 #endif  #endif
   
   #include "carp.h"
   #if NCARP > 0
   #include <netinet/ip_carp.h>
   #endif
   
 #ifdef IPX  #ifdef IPX
 #include <netipx/ipx.h>  #include <netipx/ipx.h>
 #include <netipx/ipx_if.h>  #include <netipx/ipx_if.h>
Line 199  const uint8_t ethermulticastaddr_slowpro
Line 204  const uint8_t ethermulticastaddr_slowpro
   
 static  int ether_output(struct ifnet *, struct mbuf *,  static  int ether_output(struct ifnet *, struct mbuf *,
             struct sockaddr *, struct rtentry *);              struct sockaddr *, struct rtentry *);
 static  void ether_input(struct ifnet *, struct mbuf *);  
   
 /*  /*
  * Ethernet output routine.   * Ethernet output routine.
Line 207  static void ether_input(struct ifnet *, 
Line 211  static void ether_input(struct ifnet *, 
  * Assumes that ifp is actually pointer to ethercom structure.   * Assumes that ifp is actually pointer to ethercom structure.
  */   */
 static int  static int
 ether_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,  ether_output(struct ifnet *ifp0, struct mbuf *m0, struct sockaddr *dst,
         struct rtentry *rt0)          struct rtentry *rt0)
 {  {
         u_int16_t etype = 0;          u_int16_t etype = 0;
Line 217  ether_output(struct ifnet *ifp, struct m
Line 221  ether_output(struct ifnet *ifp, struct m
         struct rtentry *rt;          struct rtentry *rt;
         struct mbuf *mcopy = (struct mbuf *)0;          struct mbuf *mcopy = (struct mbuf *)0;
         struct ether_header *eh;          struct ether_header *eh;
           struct ifnet *ifp = ifp0;
         ALTQ_DECL(struct altq_pktattr pktattr;)          ALTQ_DECL(struct altq_pktattr pktattr;)
 #ifdef INET  #ifdef INET
         struct arphdr *ah;          struct arphdr *ah;
Line 228  ether_output(struct ifnet *ifp, struct m
Line 233  ether_output(struct ifnet *ifp, struct m
 #ifdef MBUFTRACE  #ifdef MBUFTRACE
         m_claimm(m, ifp->if_mowner);          m_claimm(m, ifp->if_mowner);
 #endif  #endif
   
   #if NCARP > 0
           if (ifp->if_type == IFT_CARP) {
                   struct ifaddr *ifa;
   
                   /* loop back if this is going to the carp interface */
                   if (dst != NULL && ifp0->if_link_state == LINK_STATE_UP &&
                       (ifa = ifa_ifwithaddr(dst)) != NULL &&
                       ifa->ifa_ifp == ifp0)
                           return (looutput(ifp0, m, dst, rt0));
   
                   ifp = ifp->if_carpdev;
                   /* ac = (struct arpcom *)ifp; */
   
                   if ((ifp0->if_flags & (IFF_UP|IFF_RUNNING)) !=
                       (IFF_UP|IFF_RUNNING))
                           senderr(ENETDOWN);
           }
   #endif /* NCARP > 0 */
   
         if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))          if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
                 senderr(ENETDOWN);                  senderr(ENETDOWN);
         if ((rt = rt0) != NULL) {          if ((rt = rt0) != NULL) {
Line 519  ether_output(struct ifnet *ifp, struct m
Line 544  ether_output(struct ifnet *ifp, struct m
                 bcopy(LLADDR(ifp->if_sadl), (caddr_t)eh->ether_shost,                  bcopy(LLADDR(ifp->if_sadl), (caddr_t)eh->ether_shost,
                     sizeof(eh->ether_shost));                      sizeof(eh->ether_shost));
   
   #if NCARP > 0
           if (ifp0 != ifp && ifp0->if_type == IFT_CARP) {
                   bcopy(LLADDR(ifp0->if_sadl), (caddr_t)eh->ether_shost,
                       sizeof(eh->ether_shost));
           }
   #endif /* NCARP > 0 */
   
 #ifdef PFIL_HOOKS  #ifdef PFIL_HOOKS
         if ((error = pfil_run_hooks(&ifp->if_pfil, &m, ifp, PFIL_OUT)) != 0)          if ((error = pfil_run_hooks(&ifp->if_pfil, &m, ifp, PFIL_OUT)) != 0)
                 return (error);                  return (error);
Line 534  ether_output(struct ifnet *ifp, struct m
Line 566  ether_output(struct ifnet *ifp, struct m
                 return (bridge_output(ifp, m, NULL, NULL));                  return (bridge_output(ifp, m, NULL, NULL));
 #endif  #endif
   
   #if NCARP > 0
           if (ifp != ifp0)
                   ifp0->if_obytes += m->m_pkthdr.len + ETHER_HDR_LEN;
   #endif /* NCARP > 0 */
   
 #ifdef ALTQ  #ifdef ALTQ
         /*          /*
          * If ALTQ is enabled on the parent interface, do           * If ALTQ is enabled on the parent interface, do
Line 651  altq_etherclassify(struct ifaltq *ifq, s
Line 688  altq_etherclassify(struct ifaltq *ifq, s
  * the packet is in the mbuf chain m with   * the packet is in the mbuf chain m with
  * the ether header.   * the ether header.
  */   */
 static void  void
 ether_input(struct ifnet *ifp, struct mbuf *m)  ether_input(struct ifnet *ifp, struct mbuf *m)
 {  {
         struct ethercom *ec = (struct ethercom *) ifp;          struct ethercom *ec = (struct ethercom *) ifp;
Line 743  ether_input(struct ifnet *ifp, struct mb
Line 780  ether_input(struct ifnet *ifp, struct mb
         } else          } else
 #endif /* NBRIDGE > 0 */  #endif /* NBRIDGE > 0 */
         {          {
   
   #if NCARP > 0
                   if (ifp->if_carp && ifp->if_type != IFT_CARP &&
                       (carp_input(m, (u_int8_t *)&eh->ether_shost,
                       (u_int8_t *)&eh->ether_dhost, eh->ether_type) == 0)) {
                           return;
                   }
   #endif /* NCARP > 0 */
                 if ((m->m_flags & (M_BCAST|M_MCAST)) == 0 &&                  if ((m->m_flags & (M_BCAST|M_MCAST)) == 0 &&
                     (ifp->if_flags & IFF_PROMISC) != 0 &&                      (ifp->if_flags & IFF_PROMISC) != 0 &&
                     memcmp(LLADDR(ifp->if_sadl), eh->ether_dhost,                      memcmp(LLADDR(ifp->if_sadl), eh->ether_dhost,

Legend:
Removed from v.1.132  
changed lines
  Added in v.1.133

CVSweb <webmaster@jp.NetBSD.org>