diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-20 23:14:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-21 00:16:39 -0400 |
commit | 8f2ddaac302a8ca364cb04efb19cd3b5cd058910 (patch) | |
tree | 162dcee7acf5194f04e0cd3ce444f7520f87553a /net/netlink | |
parent | 69a3b16ff66201cb24a772a6e3009044ec582b12 (diff) |
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>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 72c6b55af741..651792141f07 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -974,10 +974,11 @@ struct netlink_compare_arg | |||
974 | { | 974 | { |
975 | possible_net_t pnet; | 975 | possible_net_t pnet; |
976 | u32 portid; | 976 | u32 portid; |
977 | char trailer[]; | ||
978 | }; | 977 | }; |
979 | 978 | ||
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)) | ||
981 | 982 | ||
982 | static inline int netlink_compare(struct rhashtable_compare_arg *arg, | 983 | static inline int netlink_compare(struct rhashtable_compare_arg *arg, |
983 | const void *ptr) | 984 | const void *ptr) |