[PATCH v2 2/2] net: if_arp: use define instead of hard-coded value

2018-10-09 Thread Håkon Bugge
Let uapi/linux/if_arp.h include uapi/linux/if.h, where IFNAMSIZ is
defined. Then, use it in this file instead of hard-coded value.

This way, we are using an uapi defined constant, and as such,
user-space should be good.

Signed-off-by: Håkon Bugge 
Tested-by: Stephen Hemminger 

---

v1 -> v2:
   * Include uapi/linux/if.h
   * Add Stephen's t-b
---
 include/uapi/linux/if_arp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index b68b4b3d9172..f5d2dab3f610 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -24,6 +24,7 @@
 #ifndef _UAPI_LINUX_IF_ARP_H
 #define _UAPI_LINUX_IF_ARP_H
 
+#include 
 #include 
 
 /* ARP protocol HARDWARE identifiers. */
@@ -118,7 +119,7 @@ struct arpreq {
struct sockaddr arp_ha; /* hardware address  */
int arp_flags;  /* flags */
struct sockaddr arp_netmask;/* netmask (only for proxy arps) */
-   chararp_dev[16];
+   chararp_dev[IFNAMSIZ];
 };
 
 struct arpreq_old {
-- 
2.14.3



[PATCH v2 2/2] net: if_arp: use define instead of hard-coded value

2018-10-09 Thread Håkon Bugge
Let uapi/linux/if_arp.h include uapi/linux/if.h, where IFNAMSIZ is
defined. Then, use it in this file instead of hard-coded value.

This way, we are using an uapi defined constant, and as such,
user-space should be good.

Signed-off-by: Håkon Bugge 
Tested-by: Stephen Hemminger 

---

v1 -> v2:
   * Include uapi/linux/if.h
   * Add Stephen's t-b
---
 include/uapi/linux/if_arp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index b68b4b3d9172..f5d2dab3f610 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -24,6 +24,7 @@
 #ifndef _UAPI_LINUX_IF_ARP_H
 #define _UAPI_LINUX_IF_ARP_H
 
+#include 
 #include 
 
 /* ARP protocol HARDWARE identifiers. */
@@ -118,7 +119,7 @@ struct arpreq {
struct sockaddr arp_ha; /* hardware address  */
int arp_flags;  /* flags */
struct sockaddr arp_netmask;/* netmask (only for proxy arps) */
-   chararp_dev[16];
+   chararp_dev[IFNAMSIZ];
 };
 
 struct arpreq_old {
-- 
2.14.3