Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103219
b: refs/heads/master
c: 76e6ebf
h: refs/heads/master
i:
  103217: 0fa9943
  103215: 07dc556
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Jul 6, 2008
1 parent 1ccf005 commit fb19a8b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f43798c27684ab925adde7d8acc34c78c6e50df8
refs/heads/master: 76e6ebfb40a2455c18234dcb0f9df37533215461
2 changes: 1 addition & 1 deletion trunk/include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct in_device;
extern int ip_rt_init(void);
extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
__be32 src, struct net_device *dev);
extern void rt_cache_flush(int how);
extern void rt_cache_flush(struct net *net, int how);
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo
switch (event) {
case NETDEV_CHANGEADDR:
neigh_changeaddr(&arp_tbl, dev);
rt_cache_flush(0);
rt_cache_flush(dev_net(dev), 0);
break;
default:
break;
Expand Down
8 changes: 5 additions & 3 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
dev_disable_lro(idev->dev);
}
rtnl_unlock();
rt_cache_flush(0);
rt_cache_flush(net, 0);
}
}

Expand All @@ -1362,9 +1362,10 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
int *valp = ctl->data;
int val = *valp;
int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
struct net *net = ctl->extra2;

if (write && *valp != val)
rt_cache_flush(0);
rt_cache_flush(net, 0);

return ret;
}
Expand All @@ -1375,9 +1376,10 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
{
int ret = devinet_conf_sysctl(table, name, nlen, oldval, oldlenp,
newval, newlen);
struct net *net = table->extra2;

if (ret == 1)
rt_cache_flush(0);
rt_cache_flush(net, 0);

return ret;
}
Expand Down
17 changes: 9 additions & 8 deletions trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void fib_flush(struct net *net)
}

if (flushed)
rt_cache_flush(-1);
rt_cache_flush(net, -1);
}

/*
Expand Down Expand Up @@ -897,31 +897,32 @@ static void fib_disable_ip(struct net_device *dev, int force)
{
if (fib_sync_down_dev(dev, force))
fib_flush(dev_net(dev));
rt_cache_flush(0);
rt_cache_flush(dev_net(dev), 0);
arp_ifdown(dev);
}

static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct in_ifaddr *ifa = (struct in_ifaddr*)ptr;
struct net_device *dev = ifa->ifa_dev->dev;

switch (event) {
case NETDEV_UP:
fib_add_ifaddr(ifa);
#ifdef CONFIG_IP_ROUTE_MULTIPATH
fib_sync_up(ifa->ifa_dev->dev);
fib_sync_up(dev);
#endif
rt_cache_flush(-1);
rt_cache_flush(dev_net(dev), -1);
break;
case NETDEV_DOWN:
fib_del_ifaddr(ifa);
if (ifa->ifa_dev->ifa_list == NULL) {
/* Last address was deleted from this interface.
Disable IP.
*/
fib_disable_ip(ifa->ifa_dev->dev, 1);
fib_disable_ip(dev, 1);
} else {
rt_cache_flush(-1);
rt_cache_flush(dev_net(dev), -1);
}
break;
}
Expand Down Expand Up @@ -949,14 +950,14 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
#ifdef CONFIG_IP_ROUTE_MULTIPATH
fib_sync_up(dev);
#endif
rt_cache_flush(-1);
rt_cache_flush(dev_net(dev), -1);
break;
case NETDEV_DOWN:
fib_disable_ip(dev, 0);
break;
case NETDEV_CHANGEMTU:
case NETDEV_CHANGE:
rt_cache_flush(0);
rt_cache_flush(dev_net(dev), 0);
break;
}
return NOTIFY_DONE;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/fib_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)

fib_release_info(fi_drop);
if (state & FA_S_ACCESSED)
rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);
rtmsg_fib(RTM_NEWROUTE, key, fa, cfg->fc_dst_len, tb->tb_id,
&cfg->fc_nlinfo, NLM_F_REPLACE);
return 0;
Expand Down Expand Up @@ -532,7 +532,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)

if (new_f)
fz->fz_nent++;
rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);

rtmsg_fib(RTM_NEWROUTE, key, new_fa, cfg->fc_dst_len, tb->tb_id,
&cfg->fc_nlinfo, 0);
Expand Down Expand Up @@ -614,7 +614,7 @@ static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg)
write_unlock_bh(&fib_hash_lock);

if (fa->fa_state & FA_S_ACCESSED)
rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);
fn_free_alias(fa, f);
if (kill_fn) {
fn_free_node(f);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)

static void fib4_rule_flush_cache(void)
{
rt_cache_flush(-1);
rt_cache_flush(&init_net, -1);
}

static struct fib_rules_ops fib4_rules_ops_template = {
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)

fib_release_info(fi_drop);
if (state & FA_S_ACCESSED)
rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);
rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE);

Expand Down Expand Up @@ -1316,7 +1316,7 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
list_add_tail_rcu(&new_fa->fa_list,
(fa ? &fa->fa_list : fa_head));

rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);
rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id,
&cfg->fc_nlinfo, 0);
succeeded:
Expand Down Expand Up @@ -1664,7 +1664,7 @@ static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg)
trie_leaf_remove(t, l);

if (fa->fa_state & FA_S_ACCESSED)
rt_cache_flush(-1);
rt_cache_flush(cfg->fc_nlinfo.nl_net, -1);

fib_release_info(fa->fa_info);
alias_free_mem_rcu(fa);
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ static void rt_cache_invalidate(void)
* delay < 0 : invalidate cache (fast : entries will be deleted later)
* delay >= 0 : invalidate & flush cache (can be long)
*/
void rt_cache_flush(int delay)
void rt_cache_flush(struct net *net, int delay)
{
rt_cache_invalidate();
if (delay >= 0)
Expand Down Expand Up @@ -2825,7 +2825,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)

void ip_rt_multicast_event(struct in_device *in_dev)
{
rt_cache_flush(0);
rt_cache_flush(dev_net(in_dev->dev), 0);
}

#ifdef CONFIG_SYSCTL
Expand All @@ -2837,7 +2837,7 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
{
if (write) {
proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
rt_cache_flush(flush_delay);
rt_cache_flush(&init_net, flush_delay);
return 0;
}

Expand All @@ -2857,7 +2857,7 @@ static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
return -EINVAL;
if (get_user(delay, (int __user *)newval))
return -EFAULT;
rt_cache_flush(delay);
rt_cache_flush(&init_net, delay);
return 0;
}

Expand Down

0 comments on commit fb19a8b

Please sign in to comment.