Re: 1.3.94 : if_arp.h

Jonathan Layes (layes@loran.com)
Wed, 24 Apr 1996 09:24:55 -0400


On Apr 23, 1:24, Thomas Quinot <thomas@cuivre.fdn.fr> wrote:
Subject: 1.3.94 : if_arp.h
>It looks like if_arp.h lacks a #include (it uses MAX_ADDR_LEN from
>netdevice.h).

I'm getting a bit tired of writing in reply to this problem. Don't:
#include <linux/netdevice.h>
but instead just hard code the length of the hardware address field.
If you include linux/netdevice.h, then lots of programs that use if_arp.h
won't compile (especially c++ programs). So, please, don't do that. I'm
sorry I ever used the constant MAX_ADDR_LEN, in if_arp.h; I should have
just hard coded the length of the MAC address in the first place,
like most of the other net header files do.

Linus, I have sent this patch to various other places about five times
now, but it hasn't made its way to you yet. Could you include
this ASAP? thanks, jonathan

--- linux-1.3.89.orig/include/linux/if_arp.h Mon Apr 1 02:46:30 1996
+++ linux-1.3.89/include/linux/if_arp.h Tue Apr 16 08:55:19 1996
@@ -22,6 +22,8 @@
#ifndef _LINUX_IF_ARP_H
#define _LINUX_IF_ARP_H

+#include <linux/socket.h>
+
/* ARP protocol HARDWARE identifiers. */
#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
@@ -116,7 +118,7 @@
unsigned short req; /* request type */
__u32 ip; /* ip address of entry */
__u32 mask; /* netmask - used for proxy */
- unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */
+ unsigned char ha[7]; /* Hardware address */
unsigned long last_used; /* For expiry */
unsigned long last_updated; /* For expiry */
unsigned int flags; /* Control status */