uapi: MAX_ADDR_LEN vs. numeric 32
Subsystems (2)
Hi,
First, thanks Dmitry for fixing several uapi compilation problems in user space. I got a bit demotivated about the slow review progress, e.g. no feedback what so ever, on some of the patches, but lets try again...
I rebased my tree now and saw
commit 745cb7f8a5de0805cade3de3991b7a95317c7c73
Author: Dmitry V. Levin <[email protected]> Date: Tue Mar 7 23:50:50 2017 +0300
uapi: fix linux/packet_diag.h userspace compilation error
which does:
include/uapi/linux/packet_diag.h +1 -1
@@ -64,7 +64,7 @@ struct packet_diag_mclist {__u32 pdmc_count;__u16 pdmc_type;__u16 pdmc_alen; -__u8 pdmc_addr[MAX_ADDR_LEN ]; +__u8 pdmc_addr[32 ];/* MAX_ADDR_LEN */ };struct packet_diag_ring {
In my tree I had fixed that case with:
include/uapi/linux/packet_diag.h +1 -0
@@ -2,6 +2,7 @@#define __PACKET_DIAG_H__#include <linux/types.h> +#include <linux/netdevice.h> struct packet_diag_req {__u8 sdiag_family;
since netdevice.h has the definition also in user space
#define MAX_ADDR_LEN 32 /* Largest hardware address length */
I find using MAX_ADDR_LEN better than numeric 32, though I doubt this will change any time soon. Would you mind if I change packet_diag.h and if_link.h to use that instead and fix the userspace compilation problems by including netdevice.h?
Thanks,
-Mikko
Hi,
Quoted 2 lines · Mikko Rapeli
First, thanks Dmitry for fixing several uapi compilation problems in user space. I got a bit demotivated
That's quite understandable.
Quoted 38 lines
about the slow review progress, e.g.
no feedback what so ever, on some of the patches, but lets try again...I rebased my tree now and saw
commit
745cb7f8a5de0805cade3de3991b7a95317c7c73Author: Dmitry V. Levin <[email protected]> Date: Tue Mar 7 23:50:50 2017 +0300uapi: fix
linux/packet_diag.huserspace compilation errorwhich does:
include/uapi/linux/packet_diag.h +1
-1@@ -64,7 +64,7 @@ struct packet_diag_mclist {__u32 pdmc_count;__u16 pdmc_type;__u16 pdmc_alen; -__u8 pdmc_addr[MAX_ADDR_LEN ]; +__u8 pdmc_addr[32 ];/* MAX_ADDR_LEN */ };struct packet_diag_ring {In my tree I had fixed that case with:
include/uapi/linux/packet_diag.h +1
-0@@ -2,6 +2,7 @@#define __PACKET_DIAG_H__#include <linux/types.h> +#include <linux/netdevice.h> struct packet_diag_req {__u8 sdiag_family;
Quoted 8 lines
since
netdevice.hhas the definition also in user space#define
MAX_ADDR_LEN32 /* Largest hardware address length */I find using
MAX_ADDR_LENbetter than numeric 32, though I doubt this will change any time soon. Would you mind if I changepacket_diag.handif_link.hto use that instead and fix the userspace compilation problems by includingnetdevice.h?
The alternative fix, that is, to include <linux/netdevice.h> which pulls in other headers and a lot of definitions with them, has been mentioned in the discussion, too.
We decided that the fix that was applied would be the least of all evils.
Signature · 1 line
ldv
Quoted 8 lines · Dmitry V. Levin
Quoted 5 lines · Mikko Rapeli
I find using
MAX_ADDR_LENbetter than numeric 32, though I doubt this will change any time soon. Would you mind if I changepacket_diag.handif_link.hto use that instead and fix the userspace compilation problems by includingnetdevice.h?
Quoted 4 lines
The alternative fix, that is, to include <
linux/netdevice.h> which pulls in other headers and a lot of definitions with them, has been mentioned in the discussion, too.
We decided that the fix that was applied would be the least of all evils.
Ok, that's fine then. I'll drop my netdevice.h inclusion patch.
Thanks,
-Mikko