]> git.baikalelectronics.ru Git - kernel.git/commit
[NET]: Fix fib_rules compatibility breakage
authorThomas Graf <tgraf@suug.ch>
Sat, 24 Mar 2007 19:46:02 +0000 (12:46 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 26 Mar 2007 01:48:00 +0000 (18:48 -0700)
commit20c74c47a4f42f28fe5c23bd3d57a6d2d4ce74f4
tree96dc2e47b36589636b15602dcdcfd2ea426260b7
parenta2b5baab00d07d52987012d106a91b7f9a38a592
[NET]: Fix fib_rules compatibility breakage

Based upon a patch from Patrick McHardy.

The fib_rules netlink attribute policy introduced in 2.6.19 broke
userspace compatibilty. When specifying a rule with "from all"
or "to all", iproute adds a zero byte long netlink attribute,
but the policy requires all addresses to have a size equal to
sizeof(struct in_addr)/sizeof(struct in6_addr), resulting in a
validation error.

Check attribute length of FRA_SRC/FRA_DST in the generic framework
by letting the family specific rules implementation provide the
length of an address. Report an error if address length is non
zero but no address attribute is provided. Fix actual bug by
checking address length for non-zero instead of relying on
availability of attribute.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/fib_rules.h
net/core/fib_rules.c
net/decnet/dn_rules.c
net/ipv4/fib_rules.c
net/ipv6/fib6_rules.c