diff options
author | Julian Anastasov <ja@ssi.bg> | 2013-03-21 05:58:00 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-04-01 18:23:38 -0400 |
commit | 313eae637f0ce2a37fc1e591f5ac930ec7301b8f (patch) | |
tree | b4025dc492938facda35add42b3eacb07bbf3d2c | |
parent | c90558dae51cef334f3d9d447cf7c0fd1bfe725d (diff) |
ipvs: prefer NETDEV_DOWN event to free cached dsts
The real server becomes unreachable on down event,
no need to wait device unregistration. Should help in
releasing dsts early before dst->dev is replaced with lo.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 8104120f16a5..6b55ba69c800 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -1514,10 +1514,8 @@ __ip_vs_dev_reset(struct ip_vs_dest *dest, struct net_device *dev) | |||
1514 | spin_unlock_bh(&dest->dst_lock); | 1514 | spin_unlock_bh(&dest->dst_lock); |
1515 | 1515 | ||
1516 | } | 1516 | } |
1517 | /* | 1517 | /* Netdev event receiver |
1518 | * Netdev event receiver | 1518 | * Currently only NETDEV_DOWN is handled to release refs to cached dsts |
1519 | * Currently only NETDEV_UNREGISTER is handled, i.e. if we hold a reference to | ||
1520 | * a device that is "unregister" it must be released. | ||
1521 | */ | 1519 | */ |
1522 | static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, | 1520 | static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, |
1523 | void *ptr) | 1521 | void *ptr) |
@@ -1529,7 +1527,7 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, | |||
1529 | struct ip_vs_dest *dest; | 1527 | struct ip_vs_dest *dest; |
1530 | unsigned int idx; | 1528 | unsigned int idx; |
1531 | 1529 | ||
1532 | if (event != NETDEV_UNREGISTER || !ipvs) | 1530 | if (event != NETDEV_DOWN || !ipvs) |
1533 | return NOTIFY_DONE; | 1531 | return NOTIFY_DONE; |
1534 | IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); | 1532 | IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); |
1535 | EnterFunction(2); | 1533 | EnterFunction(2); |