summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2004-03-14 05:24:54 +0000
committermdodd <mdodd@FreeBSD.org>2004-03-14 05:24:54 +0000
commit07e9f5afcafa05803364f4238c2794141edf058c (patch)
treefa04f6c12f731d091e642544a54bdf19c0a8e3c3
parent76b946302c8928c38179cf60c7c3f5e5a30a3c33 (diff)
downloadFreeBSD-src-07e9f5afcafa05803364f4238c2794141edf058c.zip
FreeBSD-src-07e9f5afcafa05803364f4238c2794141edf058c.tar.gz
Handle AF_ARP in *_output()
Obtained from: NetBSD
-rw-r--r--sys/net/if_ethersubr.c27
-rw-r--r--sys/net/if_fddisubr.c27
-rw-r--r--sys/net/if_iso88025subr.c27
3 files changed, 81 insertions, 0 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 2bffbaf..16d8f52 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -168,6 +168,33 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
return (0); /* if not yet resolved */
type = htons(ETHERTYPE_IP);
break;
+ case AF_ARP:
+ {
+ struct arphdr *ah;
+ ah = mtod(m, struct arphdr *);
+ ah->ar_hrd = htons(ARPHRD_ETHER);
+
+ loop_copy = -1; /* if this is for us, don't do it */
+
+ switch(ntohs(ah->ar_op)) {
+ case ARPOP_REVREQUEST:
+ case ARPOP_REVREPLY:
+ type = htons(ETHERTYPE_REVARP);
+ break;
+ case ARPOP_REQUEST:
+ case ARPOP_REPLY:
+ default:
+ type = htons(ETHERTYPE_ARP);
+ break;
+ }
+
+ if (m->m_flags & M_BCAST)
+ bcopy(ifp->if_broadcastaddr, edst, ETHER_ADDR_LEN);
+ else
+ bcopy(ar_tha(ah), edst, ETHER_ADDR_LEN);
+
+ }
+ break;
#endif
#ifdef INET6
case AF_INET6:
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index e6c1920..c8abd63 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -146,6 +146,33 @@ fddi_output(ifp, m, dst, rt0)
type = htons(ETHERTYPE_IP);
break;
}
+ case AF_ARP:
+ {
+ struct arphdr *ah;
+ ah = mtod(m, struct arphdr *);
+ ah->ar_hrd = htons(ARPHRD_ETHER);
+
+ loop_copy = -1; /* if this is for us, don't do it */
+
+ switch (ntohs(ah->ar_op)) {
+ case ARPOP_REVREQUEST:
+ case ARPOP_REVREPLY:
+ type = htons(ETHERTYPE_REVARP);
+ break;
+ case ARPOP_REQUEST:
+ case ARPOP_REPLY:
+ default:
+ type = htons(ETHERTYPE_ARP);
+ break;
+ }
+
+ if (m->m_flags & M_BCAST)
+ bcopy(ifp->if_broadcastaddr, edst, FDDI_ADDR_LEN);
+ else
+ bcopy(ar_tha(ah), edst, FDDI_ADDR_LEN);
+
+ }
+ break;
#endif /* INET */
#ifdef INET6
case AF_INET6:
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 456307a..e6d3d74 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -292,6 +292,33 @@ iso88025_output(ifp, m, dst, rt0)
return (0); /* if not yet resolved */
snap_type = ETHERTYPE_IP;
break;
+ case AF_ARP:
+ {
+ struct arphdr *ah;
+ ah = mtod(m, struct arphdr *);
+ ah->ar_hrd = htons(ARPHRD_IEEE802);
+
+ loop_copy = -1; /* if this is for us, don't do it */
+
+ switch(ntohs(ah->ar_op)) {
+ case ARPOP_REVREQUEST:
+ case ARPOP_REVREPLY:
+ snap_type = ETHERTYPE_REVARP;
+ break;
+ case ARPOP_REQUEST:
+ case ARPOP_REPLY:
+ default:
+ snap_type = ETHERTYPE_ARP;
+ break;
+ }
+
+ if (m->m_flags & M_BCAST)
+ bcopy(ifp->if_broadcastaddr, edst, ISO88025_ADDR_LEN);
+ else
+ bcopy(ar_tha(ah), edst, ISO88025_ADDR_LEN);
+
+ }
+ break;
#endif /* INET */
#ifdef INET6
case AF_INET6:
OpenPOWER on IntegriCloud