diff options
author | dg <dg@FreeBSD.org> | 1996-06-13 02:54:19 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1996-06-13 02:54:19 +0000 |
commit | 4b74beee2c4e7645ff3559f745c48307cef827af (patch) | |
tree | 13745ac97ad33fd45ecc966358fabc7be57b37dc /sys/netinet | |
parent | 3f082d87f9ee5b828933898d2f72eed913c306d6 (diff) | |
download | FreeBSD-src-4b74beee2c4e7645ff3559f745c48307cef827af.zip FreeBSD-src-4b74beee2c4e7645ff3559f745c48307cef827af.tar.gz |
Keep ether_type in network order for BPF to be consistent with other
systems.
Submitted by: Ted Lemon, Matt Thomas, and others. Retrofitted for
-current by me.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 4354d93..e5bf08f 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.29 1996/03/23 01:32:29 fenner Exp $ + * $Id: if_ether.c,v 1.30 1996/06/08 08:18:56 bde Exp $ */ /* @@ -284,7 +284,7 @@ arprequest(ac, sip, tip, enaddr) eh = (struct ether_header *)sa.sa_data; bzero((caddr_t)ea, sizeof (*ea)); (void)memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost)); - eh->ether_type = ETHERTYPE_ARP; /* if_output will swap */ + eh->ether_type = htons(ETHERTYPE_ARP); /* if_output will not swap */ ea->arp_hrd = htons(ARPHRD_ETHER); ea->arp_pro = htons(ETHERTYPE_IP); ea->arp_hln = sizeof(ea->arp_sha); /* hardware address length */ @@ -557,7 +557,7 @@ reply: ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */ eh = (struct ether_header *)sa.sa_data; (void)memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost)); - eh->ether_type = ETHERTYPE_ARP; + eh->ether_type = htons(ETHERTYPE_ARP); sa.sa_family = AF_UNSPEC; sa.sa_len = sizeof(sa); (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0); |