]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix a struct size problem on Linux/ARM32.
authorTed Lemon <source@isc.org>
Thu, 11 Nov 1999 16:10:43 +0000 (16:10 +0000)
committerTed Lemon <source@isc.org>
Thu, 11 Nov 1999 16:10:43 +0000 (16:10 +0000)
common/ethernet.c
includes/netinet/if_ether.h

index 311c3c9af714665bd7eaced075dd275969385b9c..41c0a309e03dad295bfcaf2680083bddda9bdb84 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: ethernet.c,v 1.1.2.1 1999/05/27 17:35:47 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: ethernet.c,v 1.1.2.2 1999/11/11 16:10:41 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -79,8 +79,8 @@ void assemble_ethernet_header (interface, buf, bufix, to)
        eh.ether_type = htons (ETHERTYPE_IP);
 #endif
 
-       memcpy (&buf [*bufix], &eh, sizeof eh);
-       *bufix += sizeof eh;
+       memcpy (&buf [*bufix], &eh, ETHER_HEADER_SIZE);
+       *bufix += ETHER_HEADER_SIZE;
 }
 #endif /* PACKET_ASSEMBLY */
 
@@ -95,7 +95,7 @@ ssize_t decode_ethernet_header (interface, buf, bufix, from)
 {
   struct ether_header eh;
 
-  memcpy (&eh, buf + bufix, sizeof eh);
+  memcpy (&eh, buf + bufix, ETHER_HEADER_SIZE);
 
 #ifdef USERLAND_FILTER
   if (ntohs (eh.ether_type) != ETHERTYPE_IP)
index cae53863c54cdc1c1404284ba14f46c2c82009b4..f61b18b62fee9a442fb274d21d5e4cfa81a2ade1 100644 (file)
@@ -72,3 +72,4 @@ struct        ether_header {
 #define        ETHERMTU        1500
 #define        ETHERMIN        (60-14)
 
+#define ETHER_HEADER_SIZE (ETHER_ADDR_LEN * 2 + sizeof (u_int16_t))