diff options
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 11fee87a0cc1..7c264a74edc0 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -732,7 +732,7 @@ EXPORT_SYMBOL(xfrm_policy_byid); | |||
732 | 732 | ||
733 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 733 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
734 | static inline int | 734 | static inline int |
735 | xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) | 735 | xfrm_policy_flush_secctx_check(struct net *net, u8 type, struct xfrm_audit *audit_info) |
736 | { | 736 | { |
737 | int dir, err = 0; | 737 | int dir, err = 0; |
738 | 738 | ||
@@ -742,7 +742,7 @@ xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) | |||
742 | int i; | 742 | int i; |
743 | 743 | ||
744 | hlist_for_each_entry(pol, entry, | 744 | hlist_for_each_entry(pol, entry, |
745 | &init_net.xfrm.policy_inexact[dir], bydst) { | 745 | &net->xfrm.policy_inexact[dir], bydst) { |
746 | if (pol->type != type) | 746 | if (pol->type != type) |
747 | continue; | 747 | continue; |
748 | err = security_xfrm_policy_delete(pol->security); | 748 | err = security_xfrm_policy_delete(pol->security); |
@@ -754,9 +754,9 @@ xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) | |||
754 | return err; | 754 | return err; |
755 | } | 755 | } |
756 | } | 756 | } |
757 | for (i = init_net.xfrm.policy_bydst[dir].hmask; i >= 0; i--) { | 757 | for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { |
758 | hlist_for_each_entry(pol, entry, | 758 | hlist_for_each_entry(pol, entry, |
759 | init_net.xfrm.policy_bydst[dir].table + i, | 759 | net->xfrm.policy_bydst[dir].table + i, |
760 | bydst) { | 760 | bydst) { |
761 | if (pol->type != type) | 761 | if (pol->type != type) |
762 | continue; | 762 | continue; |
@@ -776,19 +776,19 @@ xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) | |||
776 | } | 776 | } |
777 | #else | 777 | #else |
778 | static inline int | 778 | static inline int |
779 | xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) | 779 | xfrm_policy_flush_secctx_check(struct net *net, u8 type, struct xfrm_audit *audit_info) |
780 | { | 780 | { |
781 | return 0; | 781 | return 0; |
782 | } | 782 | } |
783 | #endif | 783 | #endif |
784 | 784 | ||
785 | int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) | 785 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) |
786 | { | 786 | { |
787 | int dir, err = 0; | 787 | int dir, err = 0; |
788 | 788 | ||
789 | write_lock_bh(&xfrm_policy_lock); | 789 | write_lock_bh(&xfrm_policy_lock); |
790 | 790 | ||
791 | err = xfrm_policy_flush_secctx_check(type, audit_info); | 791 | err = xfrm_policy_flush_secctx_check(net, type, audit_info); |
792 | if (err) | 792 | if (err) |
793 | goto out; | 793 | goto out; |
794 | 794 | ||
@@ -800,7 +800,7 @@ int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) | |||
800 | killed = 0; | 800 | killed = 0; |
801 | again1: | 801 | again1: |
802 | hlist_for_each_entry(pol, entry, | 802 | hlist_for_each_entry(pol, entry, |
803 | &init_net.xfrm.policy_inexact[dir], bydst) { | 803 | &net->xfrm.policy_inexact[dir], bydst) { |
804 | if (pol->type != type) | 804 | if (pol->type != type) |
805 | continue; | 805 | continue; |
806 | hlist_del(&pol->bydst); | 806 | hlist_del(&pol->bydst); |
@@ -818,10 +818,10 @@ int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) | |||
818 | goto again1; | 818 | goto again1; |
819 | } | 819 | } |
820 | 820 | ||
821 | for (i = init_net.xfrm.policy_bydst[dir].hmask; i >= 0; i--) { | 821 | for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { |
822 | again2: | 822 | again2: |
823 | hlist_for_each_entry(pol, entry, | 823 | hlist_for_each_entry(pol, entry, |
824 | init_net.xfrm.policy_bydst[dir].table + i, | 824 | net->xfrm.policy_bydst[dir].table + i, |
825 | bydst) { | 825 | bydst) { |
826 | if (pol->type != type) | 826 | if (pol->type != type) |
827 | continue; | 827 | continue; |
@@ -842,7 +842,7 @@ int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) | |||
842 | } | 842 | } |
843 | } | 843 | } |
844 | 844 | ||
845 | init_net.xfrm.policy_count[dir] -= killed; | 845 | net->xfrm.policy_count[dir] -= killed; |
846 | } | 846 | } |
847 | atomic_inc(&flow_cache_genid); | 847 | atomic_inc(&flow_cache_genid); |
848 | out: | 848 | out: |