diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-12-05 21:03:41 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-12-05 21:03:41 +0000 |
commit | 7bf8a55d73cf7656295b8863502330fe1ac3b60e (patch) | |
tree | 140b98766e79c21fd6255a76a11cd8aabe7aabca /sbin/dhclient | |
parent | af1db0c89bd4062204f732caf0477611d87ab43b (diff) |
Nuke local #define ETHER_HEADER_SIZE and use the identical value'd
ETHER_HDR_LEN from if_ether.h. dhclient change ok matthew@ as part
of larger diff.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/packet.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/dhclient/packet.c b/sbin/dhclient/packet.c index 915863cb4c0..b793ea9cc91 100644 --- a/sbin/dhclient/packet.c +++ b/sbin/dhclient/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.19 2013/12/04 19:39:50 krw Exp $ */ +/* $OpenBSD: packet.c,v 1.20 2013/12/05 21:03:40 krw Exp $ */ /* Packet assembly code, originally contributed by Archie Cobbs. */ @@ -46,8 +46,6 @@ #include <netinet/ip.h> #include <netinet/udp.h> -#define ETHER_HEADER_SIZE (ETHER_ADDR_LEN * 2 + sizeof(u_int16_t)) - u_int32_t checksum(unsigned char *, unsigned, u_int32_t); u_int32_t wrapsum(u_int32_t); @@ -101,8 +99,8 @@ assemble_hw_header(unsigned char *buf, int *bufix, struct hardware *to) eh.ether_type = htons(ETHERTYPE_IP); - memcpy(&buf[*bufix], &eh, ETHER_HEADER_SIZE); - *bufix += ETHER_HEADER_SIZE; + memcpy(&buf[*bufix], &eh, ETHER_HDR_LEN); + *bufix += ETHER_HDR_LEN; } void @@ -147,7 +145,7 @@ decode_hw_header(unsigned char *buf, int bufix, struct hardware *from) { struct ether_header eh; - memcpy(&eh, buf + bufix, ETHER_HEADER_SIZE); + memcpy(&eh, buf + bufix, ETHER_HDR_LEN); memcpy(from->haddr, eh.ether_shost, sizeof(eh.ether_shost)); from->htype = ARPHRD_ETHER; |