diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-28 17:41:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:08:07 -0500 |
commit | b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4 (patch) | |
tree | 672c08c95229a6ac242ab12a5195dceddb0f3127 /net/ipv4 | |
parent | 4f84d82f7a623f8641af2574425c329431ff158f (diff) |
[NETNS]: Consolidate kernel netlink socket destruction.
Create a specific helper for netlink kernel socket disposal. This just
let the code look better and provides a ground for proper disposal
inside a namespace.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Tested-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/fib_frontend.c | 2 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 4e5216e9aacb..e787d2151152 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -881,7 +881,7 @@ static void nl_fib_lookup_exit(struct net *net) | |||
881 | * initial network namespace. So the socket will be safe to free. | 881 | * initial network namespace. So the socket will be safe to free. |
882 | */ | 882 | */ |
883 | net->ipv4.fibnl->sk_net = get_net(&init_net); | 883 | net->ipv4.fibnl->sk_net = get_net(&init_net); |
884 | sock_release(net->ipv4.fibnl->sk_socket); | 884 | netlink_kernel_release(net->ipv4.fibnl); |
885 | } | 885 | } |
886 | 886 | ||
887 | static void fib_disable_ip(struct net_device *dev, int force) | 887 | static void fib_disable_ip(struct net_device *dev, int force) |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index e468e7a7aac4..605ed2cd7972 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -935,7 +935,7 @@ out_free_table: | |||
935 | 935 | ||
936 | static void __exit inet_diag_exit(void) | 936 | static void __exit inet_diag_exit(void) |
937 | { | 937 | { |
938 | sock_release(idiagnl->sk_socket); | 938 | netlink_kernel_release(idiagnl); |
939 | kfree(inet_diag_table); | 939 | kfree(inet_diag_table); |
940 | } | 940 | } |
941 | 941 | ||
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 7361315f20c6..5109839da222 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -605,7 +605,7 @@ cleanup_sysctl: | |||
605 | unregister_netdevice_notifier(&ipq_dev_notifier); | 605 | unregister_netdevice_notifier(&ipq_dev_notifier); |
606 | proc_net_remove(&init_net, IPQ_PROC_FS_NAME); | 606 | proc_net_remove(&init_net, IPQ_PROC_FS_NAME); |
607 | cleanup_ipqnl: | 607 | cleanup_ipqnl: |
608 | sock_release(ipqnl->sk_socket); | 608 | netlink_kernel_release(ipqnl); |
609 | mutex_lock(&ipqnl_mutex); | 609 | mutex_lock(&ipqnl_mutex); |
610 | mutex_unlock(&ipqnl_mutex); | 610 | mutex_unlock(&ipqnl_mutex); |
611 | 611 | ||
@@ -624,7 +624,7 @@ static void __exit ip_queue_fini(void) | |||
624 | unregister_netdevice_notifier(&ipq_dev_notifier); | 624 | unregister_netdevice_notifier(&ipq_dev_notifier); |
625 | proc_net_remove(&init_net, IPQ_PROC_FS_NAME); | 625 | proc_net_remove(&init_net, IPQ_PROC_FS_NAME); |
626 | 626 | ||
627 | sock_release(ipqnl->sk_socket); | 627 | netlink_kernel_release(ipqnl); |
628 | mutex_lock(&ipqnl_mutex); | 628 | mutex_lock(&ipqnl_mutex); |
629 | mutex_unlock(&ipqnl_mutex); | 629 | mutex_unlock(&ipqnl_mutex); |
630 | 630 | ||
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index fa24efaf3eaa..b192756c6d0d 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -415,7 +415,7 @@ static int __init ulog_tg_init(void) | |||
415 | 415 | ||
416 | ret = xt_register_target(&ulog_tg_reg); | 416 | ret = xt_register_target(&ulog_tg_reg); |
417 | if (ret < 0) { | 417 | if (ret < 0) { |
418 | sock_release(nflognl->sk_socket); | 418 | netlink_kernel_release(nflognl); |
419 | return ret; | 419 | return ret; |
420 | } | 420 | } |
421 | if (nflog) | 421 | if (nflog) |
@@ -434,7 +434,7 @@ static void __exit ulog_tg_exit(void) | |||
434 | if (nflog) | 434 | if (nflog) |
435 | nf_log_unregister(&ipt_ulog_logger); | 435 | nf_log_unregister(&ipt_ulog_logger); |
436 | xt_unregister_target(&ulog_tg_reg); | 436 | xt_unregister_target(&ulog_tg_reg); |
437 | sock_release(nflognl->sk_socket); | 437 | netlink_kernel_release(nflognl); |
438 | 438 | ||
439 | /* remove pending timers and free allocated skb's */ | 439 | /* remove pending timers and free allocated skb's */ |
440 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) { | 440 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) { |