diff options
-rw-r--r-- | sys/dev/cm/smc90cx6.c | 16 | ||||
-rw-r--r-- | sys/net/if_arcsubr.c | 25 |
2 files changed, 16 insertions, 25 deletions
diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index df4c3e7..9347b5d 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -68,13 +68,6 @@ #include <net/if_dl.h> #include <net/if_types.h> #include <net/if_arc.h> -#include <net/bpf.h> - -#if 0 -#if NBPFILTER > 0 -#include <net/bpfdesc.h> -#endif -#endif #include <dev/cm/smc90cx6reg.h> #include <dev/cm/smc90cx6var.h> @@ -512,15 +505,6 @@ cm_start(ifp) if (m == 0) return; - /* - * If bpf is listening on this interface, let it - * see the packet before we commit it to the wire - * - * (can't give the copy in A2060 card RAM to bpf, because - * that RAM is just accessed as on every other byte) - */ - BPF_MTAP(ifp, m); - #ifdef CM_DEBUG if (m->m_len < ARC_HDRLEN) m = m_pullup(m, ARC_HDRLEN);/* gcc does structure padding */ diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 1fc68c3..562149f 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -89,6 +89,8 @@ static int arc_resolvemulti(struct ifnet *, struct sockaddr **, u_int8_t arcbroadcastaddr = 0; +#define ARC_LLADDR(ifp) (*(u_int8_t *)IF_LLADDR(ifp)) + #define senderr(e) { error = (e); goto bad;} #define SIN(s) ((struct sockaddr_in *)s) #define SIPX(s) ((struct sockaddr_ipx *)s) @@ -111,6 +113,7 @@ arc_output(ifp, m, dst, rt0) int error; u_int8_t atype, adst; int loop_copy = 0; + int isphds; if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) return(ENETDOWN); /* m, m1 aren't initialized yet */ @@ -208,13 +211,18 @@ arc_output(ifp, m, dst, rt0) senderr(EAFNOSUPPORT); } - M_PREPEND(m, ARC_HDRLEN, M_NOWAIT); + isphds = arc_isphds(atype); + M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); ah = mtod(m, struct arc_header *); ah->arc_type = atype; ah->arc_dhost = adst; - ah->arc_shost = *IF_LLADDR(ifp); + ah->arc_shost = ARC_LLADDR(ifp); + if (isphds) { + ah->arc_flag = 0; + ah->arc_seqid = 0; + } if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { @@ -282,7 +290,7 @@ arc_frag_next(ifp) ac->arc_shost = ah->arc_shost; ac->arc_type = ah->arc_type; - m_adj(m, ARC_HDRLEN); + m_adj(m, ARC_HDRNEWLEN); ac->curr_frag = m; } @@ -535,9 +543,9 @@ arc_input(ifp, m) ah = mtod(m, struct arc_header *); /* does this belong to us? */ - if ((ifp->if_flags & IFF_PROMISC) != 0 + if ((ifp->if_flags & IFF_PROMISC) == 0 && ah->arc_dhost != arcbroadcastaddr - && ah->arc_dhost != *IF_LLADDR(ifp)) { + && ah->arc_dhost != ARC_LLADDR(ifp)) { m_freem(m); return; } @@ -626,7 +634,7 @@ arc_storelladdr(ifp, lla) struct ifnet *ifp; u_int8_t lla; { - *IF_LLADDR(ifp) = lla; + ARC_LLADDR(ifp) = lla; } /* @@ -713,7 +721,7 @@ arc_ioctl(ifp, command, data) struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr); if (ipx_nullhost(*ina)) - ina->x_host.c_host[5] = *IF_LLADDR(ifp); + ina->x_host.c_host[5] = ARC_LLADDR(ifp); else arc_storelladdr(ifp, ina->x_host.c_host[5]); @@ -735,8 +743,7 @@ arc_ioctl(ifp, command, data) struct sockaddr *sa; sa = (struct sockaddr *) &ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, ARC_ADDR_LEN); + *(u_int8_t *)sa->sa_data = ARC_LLADDR(ifp); } break; |