Skip to content

Commit

Permalink
ipv4: Fix scope value used in route src-address caching.
Browse files Browse the repository at this point in the history
We have to use cfg->fc_scope not the final nh_scope value.

Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 8, 2011
1 parent 1fc050a commit a7ac8fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/net/ip_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct fib_nh {
struct fib_info *nh_parent;
unsigned nh_flags;
unsigned char nh_scope;
unsigned char nh_cfg_scope;
#ifdef CONFIG_IP_ROUTE_MULTIPATH
int nh_weight;
int nh_power;
Expand Down
5 changes: 3 additions & 2 deletions net/ipv4/fib_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,10 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
}

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_gw,
nexthop_nh->nh_scope);
nexthop_nh->nh_cfg_scope);
} endfor_nexthops(fi)

link_it:
Expand Down Expand Up @@ -1141,7 +1142,7 @@ void fib_update_nh_saddrs(struct net_device *dev)
continue;
nh->nh_saddr = inet_select_addr(nh->nh_dev,
nh->nh_gw,
nh->nh_scope);
nh->nh_cfg_scope);
}
}

Expand Down

0 comments on commit a7ac8fc

Please sign in to comment.