]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: match prefsrc when deleting routes
authorJulian Anastasov <ja@ssi.bg>
Sat, 19 Mar 2011 12:13:46 +0000 (12:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Mar 2011 08:06:31 +0000 (01:06 -0700)
commitbc7c1be24d91462b3509a5155d963ab89d4a1c85
tree4e75f3e98912f917214674fafb09e7d787a029c1
parentdc88d216b319f9c0832a3285ab8d3257efde2402
ipv4: match prefsrc when deleting routes

fib_table_delete forgets to match the routes by prefsrc.
Callers can specify known IP in fc_prefsrc and we should remove
the exact route. This is needed for cases when same local or
broadcast addresses are used in different subnets and the
routes differ only in prefsrc. All callers that do not provide
fc_prefsrc will ignore the route prefsrc as before and will
delete the first occurence. That is how the ip route del default
magic works.

Current callers are:

- ip_rt_ioctl where rtentry_to_fib_config provides fc_prefsrc only
when the provided device name matches IP label with colon.

- inet_rtm_delroute where RTA_PREFSRC is optional too

- fib_magic which deals with routes when deleting addresses
and where the fc_prefsrc is always set with the primary IP
for the concerned IFA.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c