Commit a7ac8fc1 authored by David S. Miller's avatar David S. Miller

ipv4: Fix scope value used in route src-address caching.

We have to use cfg->fc_scope not the final nh_scope value.
Reported-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1fc050a1
...@@ -51,6 +51,7 @@ struct fib_nh { ...@@ -51,6 +51,7 @@ struct fib_nh {
struct fib_info *nh_parent; struct fib_info *nh_parent;
unsigned nh_flags; unsigned nh_flags;
unsigned char nh_scope; unsigned char nh_scope;
unsigned char nh_cfg_scope;
#ifdef CONFIG_IP_ROUTE_MULTIPATH #ifdef CONFIG_IP_ROUTE_MULTIPATH
int nh_weight; int nh_weight;
int nh_power; int nh_power;
......
...@@ -854,9 +854,10 @@ struct fib_info *fib_create_info(struct fib_config *cfg) ...@@ -854,9 +854,10 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
} }
change_nexthops(fi) { change_nexthops(fi) {
nexthop_nh->nh_cfg_scope = cfg->fc_scope;
nexthop_nh->nh_saddr = inet_select_addr(nexthop_nh->nh_dev, nexthop_nh->nh_saddr = inet_select_addr(nexthop_nh->nh_dev,
nexthop_nh->nh_gw, nexthop_nh->nh_gw,
nexthop_nh->nh_scope); nexthop_nh->nh_cfg_scope);
} endfor_nexthops(fi) } endfor_nexthops(fi)
link_it: link_it:
...@@ -1141,7 +1142,7 @@ void fib_update_nh_saddrs(struct net_device *dev) ...@@ -1141,7 +1142,7 @@ void fib_update_nh_saddrs(struct net_device *dev)
continue; continue;
nh->nh_saddr = inet_select_addr(nh->nh_dev, nh->nh_saddr = inet_select_addr(nh->nh_dev,
nh->nh_gw, nh->nh_gw,
nh->nh_scope); nh->nh_cfg_scope);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment