From f7356ef2fa763505e4568f6088a9d9d5ffd3864b Mon Sep 17 00:00:00 2001 From: mdodd Date: Sun, 21 Mar 2004 06:34:34 +0000 Subject: Handle AF_ARP. --- sys/net/if_arcsubr.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sys/net/if_arcsubr.c') diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 1912dc3..dba312b 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -142,6 +142,33 @@ arc_output(ifp, m, dst, rt0) atype = (ifp->if_flags & IFF_LINK0) ? ARCTYPE_IP_OLD : ARCTYPE_IP; break; + case AF_ARP: + { + struct arphdr *ah; + ah = mtod(m, struct arphdr *); + ah->ar_hrd = htons(ARPHRD_ARCNET); + + 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(ARCTYPE_REVARP); + break; + case ARPOP_REQUEST: + case ARPOP_REPLY: + default: + type = htons(ARCTYPE_ARP); + break; + } + + if (m->m_flags & M_BCAST) + bcopy(ifp->if_broadcastaddr, adst, ARC_ADDR_LEN); + else + bcopy(ar_tha(ah), adst, ARC_ADDR_LEN); + + } + break; #endif #ifdef INET6 case AF_INET6: -- cgit v1.1