Skip to content

Commit 8f2ddaa

Browse files
herbertxdavem330
authored andcommitted
netlink: Remove netlink_compare_arg.trailer
Instead of computing the offset from trailer, this patch computes netlink_compare_arg_len from the offset of portid and then adds 4 to it. This allows trailer to be removed. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 69a3b16 commit 8f2ddaa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/netlink/af_netlink.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,11 @@ struct netlink_compare_arg
974974
{
975975
possible_net_t pnet;
976976
u32 portid;
977-
char trailer[];
978977
};
979978

980-
#define netlink_compare_arg_len offsetof(struct netlink_compare_arg, trailer)
979+
/* Doing sizeof directly may yield 4 extra bytes on 64-bit. */
980+
#define netlink_compare_arg_len \
981+
(offsetof(struct netlink_compare_arg, portid) + sizeof(u32))
981982

982983
static inline int netlink_compare(struct rhashtable_compare_arg *arg,
983984
const void *ptr)

0 commit comments

Comments
 (0)