summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c27
1 files changed, 27 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:
OpenPOWER on IntegriCloud