aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-25 20:59:52 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 20:59:52 -0500
commit59c9940ed0ef026673cac52f2eaed77af7d486da (patch)
treed7d4e38e693178f16000eaa5ae03f415f3197f7a /net/xfrm/xfrm_output.c
parent4fb236bac9fc7d51e2267866de6d4c30e549d2f8 (diff)
netns xfrm: per-netns MIBs
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index ba90e5e50ffc..c235597ba8dd 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -49,27 +49,27 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
49 do { 49 do {
50 err = xfrm_state_check_space(x, skb); 50 err = xfrm_state_check_space(x, skb);
51 if (err) { 51 if (err) {
52 XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR); 52 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
53 goto error_nolock; 53 goto error_nolock;
54 } 54 }
55 55
56 err = x->outer_mode->output(x, skb); 56 err = x->outer_mode->output(x, skb);
57 if (err) { 57 if (err) {
58 XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEMODEERROR); 58 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEMODEERROR);
59 goto error_nolock; 59 goto error_nolock;
60 } 60 }
61 61
62 spin_lock_bh(&x->lock); 62 spin_lock_bh(&x->lock);
63 err = xfrm_state_check_expire(x); 63 err = xfrm_state_check_expire(x);
64 if (err) { 64 if (err) {
65 XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEEXPIRED); 65 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEEXPIRED);
66 goto error; 66 goto error;
67 } 67 }
68 68
69 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) { 69 if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
70 XFRM_SKB_CB(skb)->seq.output = ++x->replay.oseq; 70 XFRM_SKB_CB(skb)->seq.output = ++x->replay.oseq;
71 if (unlikely(x->replay.oseq == 0)) { 71 if (unlikely(x->replay.oseq == 0)) {
72 XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATESEQERROR); 72 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATESEQERROR);
73 x->replay.oseq--; 73 x->replay.oseq--;
74 xfrm_audit_state_replay_overflow(x, skb); 74 xfrm_audit_state_replay_overflow(x, skb);
75 err = -EOVERFLOW; 75 err = -EOVERFLOW;
@@ -90,12 +90,12 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
90 90
91resume: 91resume:
92 if (err) { 92 if (err) {
93 XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEPROTOERROR); 93 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEPROTOERROR);
94 goto error_nolock; 94 goto error_nolock;
95 } 95 }
96 96
97 if (!(skb->dst = dst_pop(dst))) { 97 if (!(skb->dst = dst_pop(dst))) {
98 XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR); 98 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
99 err = -EHOSTUNREACH; 99 err = -EHOSTUNREACH;
100 goto error_nolock; 100 goto error_nolock;
101 } 101 }
@@ -179,6 +179,7 @@ static int xfrm_output_gso(struct sk_buff *skb)
179 179
180int xfrm_output(struct sk_buff *skb) 180int xfrm_output(struct sk_buff *skb)
181{ 181{
182 struct net *net = dev_net(skb->dst->dev);
182 int err; 183 int err;
183 184
184 if (skb_is_gso(skb)) 185 if (skb_is_gso(skb))
@@ -187,7 +188,7 @@ int xfrm_output(struct sk_buff *skb)
187 if (skb->ip_summed == CHECKSUM_PARTIAL) { 188 if (skb->ip_summed == CHECKSUM_PARTIAL) {
188 err = skb_checksum_help(skb); 189 err = skb_checksum_help(skb);
189 if (err) { 190 if (err) {
190 XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR); 191 XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
191 kfree_skb(skb); 192 kfree_skb(skb);
192 return err; 193 return err;
193 } 194 }