diff options
author | mdodd <mdodd@FreeBSD.org> | 2004-03-14 05:24:54 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2004-03-14 05:24:54 +0000 |
commit | 07e9f5afcafa05803364f4238c2794141edf058c (patch) | |
tree | fa04f6c12f731d091e642544a54bdf19c0a8e3c3 /sys/net/if_ethersubr.c | |
parent | 76b946302c8928c38179cf60c7c3f5e5a30a3c33 (diff) | |
download | FreeBSD-src-07e9f5afcafa05803364f4238c2794141edf058c.zip FreeBSD-src-07e9f5afcafa05803364f4238c2794141edf058c.tar.gz |
Handle AF_ARP in *_output()
Obtained from: NetBSD
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 27 |
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: |