summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-05-10 10:01:32 +0000
committerjhay <jhay@FreeBSD.org>1997-05-10 10:01:32 +0000
commit4f2a5d896ef4c868add74c88150f6cc2bbe07aae (patch)
tree5cf75145176ed4da63c9515fd20b38394fd52177 /sys/net
parent0993d64164c5645de9b918e293cd3ae73cc6eeab (diff)
downloadFreeBSD-src-4f2a5d896ef4c868add74c88150f6cc2bbe07aae.zip
FreeBSD-src-4f2a5d896ef4c868add74c88150f6cc2bbe07aae.tar.gz
Use the MAC address of an interface for the host part of an IPX address
and not the MAC address of the first interface for every IPX address. This is more inline with the way others like Novell do it. Originally Submitted by: "Serge A. Babkin" <babkin@hq.icb.chel.su>
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c18
-rw-r--r--sys/net/if_fddisubr.c18
2 files changed, 30 insertions, 6 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index ae17b35..48295ae 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ethersubr.c,v 1.33 1997/02/22 09:41:00 peter Exp $
+ * $Id: if_ethersubr.c,v 1.34 1997/03/24 11:33:11 bde Exp $
*/
#include <sys/param.h>
@@ -176,15 +176,27 @@ ether_output(ifp, m0, dst, rt0)
#endif
#ifdef IPX
case AF_IPX:
+ {
+ struct ifaddr *ia;
+
type = htons(ETHERTYPE_IPX);
bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
(caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ipx_thishost, sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
+
+ for(ia = ifp->if_addrhead.tqh_first; ia != 0;
+ ia = ia->ifa_link.tqe_next) {
+ if(ia->ifa_addr->sa_family == AF_IPX &&
+ !bcmp((caddr_t)edst,
+ (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
+ sizeof(edst)) )
+ return (looutput(ifp, m, dst, rt));
+ }
+
/* If broadcasting on a simplex interface, loopback a copy */
if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
mcopy = m_copy(m, 0, (int)M_COPYALL);
break;
+ }
#endif
#ifdef NETATALK
case AF_APPLETALK:
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index d2f480e..3a22669 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
- * $Id: if_fddisubr.c,v 1.17 1997/03/15 19:58:43 joerg Exp $
+ * $Id: if_fddisubr.c,v 1.18 1997/03/24 11:24:46 bde Exp $
*/
#include <sys/param.h>
@@ -197,15 +197,27 @@ fddi_output(ifp, m0, dst, rt0)
#endif
#ifdef IPX
case AF_IPX:
+ {
+ struct ifaddr *ia;
+
type = htons(ETHERTYPE_IPX);
bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
(caddr_t)edst, sizeof (edst));
- if (!bcmp((caddr_t)edst, (caddr_t)&ipx_thishost, sizeof(edst)))
- return (looutput(ifp, m, dst, rt));
+
+ for(ia = ifp->if_addrhead.tqh_first; ia != 0;
+ ia = ia->ifa_link.tqe_next) {
+ if(ia->ifa_addr->sa_family == AF_IPX &&
+ !bcmp((caddr_t)edst,
+ (caddr_t)&((struct ipx_ifaddr *)ia)->ia_addr.sipx_addr.x_host,
+ sizeof(edst)) )
+ return (looutput(ifp, m, dst, rt));
+ }
+
/* If broadcasting on a simplex interface, loopback a copy */
if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
mcopy = m_copy(m, 0, (int)M_COPYALL);
break;
+ }
#endif
#ifdef NETATALK
case AF_APPLETALK: {
OpenPOWER on IntegriCloud