Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/pcmcia/if_xi.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/pcmcia/if_xi.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.54.4.1 retrieving revision 1.55 diff -u -p -r1.54.4.1 -r1.55 --- src/sys/dev/pcmcia/if_xi.c 2006/09/09 02:53:55 1.54.4.1 +++ src/sys/dev/pcmcia/if_xi.c 2006/02/20 16:50:37 1.55 @@ -1,4 +1,4 @@ -/* $NetBSD: if_xi.c,v 1.54.4.1 2006/09/09 02:53:55 rpaulo Exp $ */ +/* $NetBSD: if_xi.c,v 1.55 2006/02/20 16:50:37 thorpej Exp $ */ /* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */ /* @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.54.4.1 2006/09/09 02:53:55 rpaulo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.55 2006/02/20 16:50:37 thorpej Exp $"); #include "opt_inet.h" #include "opt_ipx.h" @@ -90,6 +90,10 @@ __KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1. #include #endif +#ifdef NS +#include +#include +#endif #if NBPFILTER > 0 #include @@ -460,18 +464,18 @@ xi_get(sc) recvcount += pktlen; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + if (m == 0) return (recvcount); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = pktlen; len = MHLEN; - top = NULL; + top = 0; mp = ⊤ while (pktlen > 0) { if (top) { MGET(m, M_DONTWAIT, MT_DATA); - if (m == NULL) { + if (m == 0) { m_freem(top); return (recvcount); } @@ -486,7 +490,7 @@ xi_get(sc) } len = MCLBYTES; } - if (top == NULL) { + if (!top) { caddr_t newdata = (caddr_t)ALIGN(m->m_data + sizeof(struct ether_header)) - sizeof(struct ether_header); @@ -510,9 +514,6 @@ xi_get(sc) /* Skip Rx packet. */ bus_space_write_2(sc->sc_bst, sc->sc_bsh, DO0, DO_SKIP_RX_PKT); - if (top == NULL) - return recvcount; - /* Trim the CRC off the end of the packet. */ m_adj(top, -ETHER_CRC_LEN); @@ -950,6 +951,22 @@ xi_ether_ioctl(ifp, cmd, data) break; #endif /* INET */ +#ifdef NS + case AF_NS: + { + struct ns_addr *ina = &IA_SNS(ifa)->sns_addr; + + if (ns_nullhost(*ina)) + ina->x_host = *(union ns_host *) + LLADDR(ifp->if_sadl); + else + memcpy(LLADDR(ifp->if_sadl), ina->x_host.c_host, + ifp->if_addrlen); + /* Set new address. */ + xi_init(sc); + break; + } +#endif /* NS */ default: xi_init(sc);