netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH  v2 0/2] net: if_arp: use define instead of hard-coded value
@ 2018-10-09 14:27 Håkon Bugge
  2018-10-09 14:27 ` [PATCH v2 1/2] net: if_arp: Fix incorrect indents Håkon Bugge
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Håkon Bugge @ 2018-10-09 14:27 UTC (permalink / raw)
  To: netdev
  Cc: stephen, David S . Miller, Kate Stewart, Thomas Gleixner,
	Greg Kroah-Hartman, Philippe Ombredanne, linux-kernel

Struct arpreq contains the name of the device. All other places in the
kernel, the define IFNAMSIZ is used to designate its size. But in
if_arp.h, a literal constant is used.

Fixed by explicitly including uapi/linu/if.h, where IFNAMSIZ is defined.

The series also fixes some incorrect indents.


v1 -> v2:
   * Include uapi/linux/if.h from if_arp.h
   * Added Stephen's t-b

Håkon Bugge (2):
  net: if_arp: Fix incorrect indents
  net: if_arp: use define instead of hard-coded value

 include/uapi/linux/if_arp.h | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

--
2.14.3



>From a36b99413ea5beca1539f4faf065f33c7c19e6a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5kon=20Bugge?= <Haakon.Bugge@oracle.com>
Date: Fri, 21 Sep 2018 11:28:36 +0200
Subject: [PATCH 0/2]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Struct arpreq contains the name of the device. All other places in the
kernel, the define IFNAMSIZ is used to designate its size. But in
if_arp.h, a literal constant is used.

As it could be good reasons to use constants instead of the defines in
include files under uapi, it seems to be OK to use the define here,
without opening a can of worms in user-land.

This because if_arp.h includes netdevice.h, which also uses
IFNAMSIZ. For the distros I have checked, this also holds true for the
use-land side.

The series also fixes some incorrect indents.

Håkon Bugge (2):
  net: if_arp: Fix incorrect indents
  net: if_arp: use define instead of hard-coded value

 include/uapi/linux/if_arp.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--
2.14.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH  v2 1/2] net: if_arp: Fix incorrect indents
  2018-10-09 14:27 [PATCH v2 0/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
@ 2018-10-09 14:27 ` Håkon Bugge
  2018-10-09 14:27 ` [PATCH v2 2/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
  2018-10-23 12:30 ` [v2,0/2] " Håkon Bugge
  2 siblings, 0 replies; 6+ messages in thread
From: Håkon Bugge @ 2018-10-09 14:27 UTC (permalink / raw)
  To: netdev
  Cc: stephen, David S . Miller, Kate Stewart, Thomas Gleixner,
	Greg Kroah-Hartman, Philippe Ombredanne, linux-kernel

Fixing incorrect indents and align comments.

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
 include/uapi/linux/if_arp.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index 4605527ca41b..b68b4b3d9172 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -114,18 +114,18 @@
 
 /* ARP ioctl request. */
 struct arpreq {
-  struct sockaddr	arp_pa;		/* protocol address		*/
-  struct sockaddr	arp_ha;		/* hardware address		*/
-  int			arp_flags;	/* flags			*/
-  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
-  char			arp_dev[16];
+	struct sockaddr	arp_pa;		/* protocol address		 */
+	struct sockaddr	arp_ha;		/* hardware address		 */
+	int		arp_flags;	/* flags			 */
+	struct sockaddr arp_netmask;    /* netmask (only for proxy arps) */
+	char		arp_dev[16];
 };
 
 struct arpreq_old {
-  struct sockaddr	arp_pa;		/* protocol address		*/
-  struct sockaddr	arp_ha;		/* hardware address		*/
-  int			arp_flags;	/* flags			*/
-  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
+	struct sockaddr	arp_pa;		/* protocol address		 */
+	struct sockaddr	arp_ha;		/* hardware address		 */
+	int		arp_flags;	/* flags			 */
+	struct sockaddr	arp_netmask;    /* netmask (only for proxy arps) */
 };
 
 /* ARP Flag values. */
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH  v2 2/2] net: if_arp: use define instead of hard-coded value
  2018-10-09 14:27 [PATCH v2 0/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
  2018-10-09 14:27 ` [PATCH v2 1/2] net: if_arp: Fix incorrect indents Håkon Bugge
@ 2018-10-09 14:27 ` Håkon Bugge
  2018-10-23 12:30 ` [v2,0/2] " Håkon Bugge
  2 siblings, 0 replies; 6+ messages in thread
From: Håkon Bugge @ 2018-10-09 14:27 UTC (permalink / raw)
  To: netdev
  Cc: stephen, David S . Miller, Kate Stewart, Thomas Gleixner,
	Greg Kroah-Hartman, Philippe Ombredanne, linux-kernel

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 <haakon.bugge@oracle.com>
Tested-by: Stephen Hemminger <stephen@networkplumber.org>

---

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 <linux/if.h>
 #include <linux/netdevice.h>
 
 /* 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) */
-	char		arp_dev[16];
+	char		arp_dev[IFNAMSIZ];
 };
 
 struct arpreq_old {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [v2,0/2] net: if_arp: use define instead of hard-coded value
  2018-10-09 14:27 [PATCH v2 0/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
  2018-10-09 14:27 ` [PATCH v2 1/2] net: if_arp: Fix incorrect indents Håkon Bugge
  2018-10-09 14:27 ` [PATCH v2 2/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
@ 2018-10-23 12:30 ` Håkon Bugge
  2018-10-23 16:11   ` David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Håkon Bugge @ 2018-10-23 12:30 UTC (permalink / raw)
  To: netdev
  Cc: Stephen Hemminger, David S . Miller, Kate Stewart,
	Thomas Gleixner, Greg Kroah-Hartman, Philippe Ombredanne,
	linux-kernel



> On 9 Oct 2018, at 16:27, Håkon Bugge <haakon.bugge@oracle.com> wrote:
> 
> Struct arpreq contains the name of the device. All other places in the
> kernel, the define IFNAMSIZ is used to designate its size. But in
> if_arp.h, a literal constant is used.
> 
> Fixed by explicitly including uapi/linu/if.h, where IFNAMSIZ is defined.
> 
> The series also fixes some incorrect indents.
> 
> 
> v1 -> v2:
>   * Include uapi/linux/if.h from if_arp.h
>   * Added Stephen's t-b
> 
> Håkon Bugge (2):
>  net: if_arp: Fix incorrect indents
>  net: if_arp: use define instead of hard-coded value
> 
> include/uapi/linux/if_arp.h | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
> ---
> 2.14.3

Just a friendly reminder.


Thxs, Håkon


> 
> 
> From a36b99413ea5beca1539f4faf065f33c7c19e6a5 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?H=C3=A5kon=20Bugge?= <Haakon.Bugge@oracle.com>
> Date: Fri, 21 Sep 2018 11:28:36 +0200
> Subject: [PATCH 0/2]
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Struct arpreq contains the name of the device. All other places in the
> kernel, the define IFNAMSIZ is used to designate its size. But in
> if_arp.h, a literal constant is used.
> 
> As it could be good reasons to use constants instead of the defines in
> include files under uapi, it seems to be OK to use the define here,
> without opening a can of worms in user-land.
> 
> This because if_arp.h includes netdevice.h, which also uses
> IFNAMSIZ. For the distros I have checked, this also holds true for the
> use-land side.
> 
> The series also fixes some incorrect indents.
> 
> Håkon Bugge (2):
>  net: if_arp: Fix incorrect indents
>  net: if_arp: use define instead of hard-coded value
> 
> include/uapi/linux/if_arp.h | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
> 
> --
> 2.14.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2,0/2] net: if_arp: use define instead of hard-coded value
  2018-10-23 12:30 ` [v2,0/2] " Håkon Bugge
@ 2018-10-23 16:11   ` David Miller
  2018-10-23 16:31     ` Håkon Bugge
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2018-10-23 16:11 UTC (permalink / raw)
  To: haakon.bugge
  Cc: netdev, stephen, kstewart, tglx, gregkh, pombredanne, linux-kernel

From: Håkon Bugge <haakon.bugge@oracle.com>
Date: Tue, 23 Oct 2018 14:30:57 +0200

> Just a friendly reminder.

Reminder for what?

Your patch was applied to the net-next tree right after it was posted,
what more do you want?

I gather that you have no idea what tree was appropriate for your change
and therefore where your should check to see if it was applied or not.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2,0/2] net: if_arp: use define instead of hard-coded value
  2018-10-23 16:11   ` David Miller
@ 2018-10-23 16:31     ` Håkon Bugge
  0 siblings, 0 replies; 6+ messages in thread
From: Håkon Bugge @ 2018-10-23 16:31 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, stephen, kstewart, tglx, gregkh, pombredanne, linux-kernel



> On 23 Oct 2018, at 18:11, David Miller <davem@davemloft.net> wrote:
> 
> From: Håkon Bugge <haakon.bugge@oracle.com>
> Date: Tue, 23 Oct 2018 14:30:57 +0200
> 
>> Just a friendly reminder.
> 
> Reminder for what?
> 
> Your patch was applied to the net-next tree right after it was posted,
> what more do you want?

Oh, my bad then. Was expecting review comments or an "Applied, thanks". Will check the respective tree next time. No need for the v2 then I assume.


Thxs, Håkon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-23 16:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 14:27 [PATCH v2 0/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
2018-10-09 14:27 ` [PATCH v2 1/2] net: if_arp: Fix incorrect indents Håkon Bugge
2018-10-09 14:27 ` [PATCH v2 2/2] net: if_arp: use define instead of hard-coded value Håkon Bugge
2018-10-23 12:30 ` [v2,0/2] " Håkon Bugge
2018-10-23 16:11   ` David Miller
2018-10-23 16:31     ` Håkon Bugge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).