]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: do not use RTM_GETLINK directly
authorFlorian Westphal <fw@strlen.de>
Thu, 10 Aug 2017 14:52:58 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 16:50:22 +0000 (09:50 -0700)
commit0f09310bd6f45f46a5d6591f4c28b89c8dc6c5d9
tree5ddd2662f10cbaad9329675ec4d6d159f8d034fd
parented4d19e639f9a5ccc73018c40377771bb98b4bbf
rtnetlink: do not use RTM_GETLINK directly

Userspace sends RTM_GETLINK type, but the kernel substracts
RTM_BASE from this, i.e. 'type' doesn't contain RTM_GETLINK
anymore but instead RTM_GETLINK - RTM_BASE.

This caused the calcit callback to not be invoked when it
should have been (and vice versa).

While at it, also fix a off-by one when checking family index. vs
handler array size.

Fixes: 49749187477 ("rtnetlink: call rtnl_calcit directly")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c