]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip route: restore_handler should check tb[RTA_PREFSRC] for local networks
authorXin Long <lucien.xin@gmail.com>
Sun, 7 Aug 2016 09:12:30 +0000 (17:12 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 18 Aug 2016 21:54:08 +0000 (14:54 -0700)
commitc85703bb9fb778ca94a3f84343406a251d23f9ba
tree20175006f9e325da1eb86ee83248d58f35bebc4a
parent9423a324bf67913f9dec4bafe1fcb28a7995c8f2
ip route: restore_handler should check tb[RTA_PREFSRC] for local networks

Prior to this patch, If one route entry's RTA_PREFSRC and RTA_GATEWAY
both were NULL, it was supposed to be restored ONLY as a local address.

But as it didn't check tb[RTA_PREFSRC] when restoring local networks,
rtattr_cmp would return a success if it was NULL, this route entry would
be restored again as a local network.

This patch is to add tb[RTA_PREFSRC] check when restoring local networks.

Fixes: 74af8dd9620e ("ip route: restore route entries in correct order")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Tested-by: Phil Sutter <phil@nwl.cc>
ip/iproute.c