aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.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_input.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_input.c')
-rw-r--r--net/xfrm/xfrm_input.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index a714dce03dc4..b4a13178fb40 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -128,7 +128,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
128 128
129 sp = secpath_dup(skb->sp); 129 sp = secpath_dup(skb->sp);
130 if (!sp) { 130 if (!sp) {
131 XFRM_INC_STATS(LINUX_MIB_XFRMINERROR); 131 XFRM_INC_STATS(net, LINUX_MIB_XFRMINERROR);
132 goto drop; 132 goto drop;
133 } 133 }
134 if (skb->sp) 134 if (skb->sp)
@@ -142,19 +142,19 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
142 142
143 seq = 0; 143 seq = 0;
144 if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) { 144 if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) {
145 XFRM_INC_STATS(LINUX_MIB_XFRMINHDRERROR); 145 XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
146 goto drop; 146 goto drop;
147 } 147 }
148 148
149 do { 149 do {
150 if (skb->sp->len == XFRM_MAX_DEPTH) { 150 if (skb->sp->len == XFRM_MAX_DEPTH) {
151 XFRM_INC_STATS(LINUX_MIB_XFRMINBUFFERERROR); 151 XFRM_INC_STATS(net, LINUX_MIB_XFRMINBUFFERERROR);
152 goto drop; 152 goto drop;
153 } 153 }
154 154
155 x = xfrm_state_lookup(net, daddr, spi, nexthdr, family); 155 x = xfrm_state_lookup(net, daddr, spi, nexthdr, family);
156 if (x == NULL) { 156 if (x == NULL) {
157 XFRM_INC_STATS(LINUX_MIB_XFRMINNOSTATES); 157 XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES);
158 xfrm_audit_state_notfound(skb, family, spi, seq); 158 xfrm_audit_state_notfound(skb, family, spi, seq);
159 goto drop; 159 goto drop;
160 } 160 }
@@ -163,22 +163,22 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
163 163
164 spin_lock(&x->lock); 164 spin_lock(&x->lock);
165 if (unlikely(x->km.state != XFRM_STATE_VALID)) { 165 if (unlikely(x->km.state != XFRM_STATE_VALID)) {
166 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEINVALID); 166 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEINVALID);
167 goto drop_unlock; 167 goto drop_unlock;
168 } 168 }
169 169
170 if ((x->encap ? x->encap->encap_type : 0) != encap_type) { 170 if ((x->encap ? x->encap->encap_type : 0) != encap_type) {
171 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEMISMATCH); 171 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMISMATCH);
172 goto drop_unlock; 172 goto drop_unlock;
173 } 173 }
174 174
175 if (x->props.replay_window && xfrm_replay_check(x, skb, seq)) { 175 if (x->props.replay_window && xfrm_replay_check(x, skb, seq)) {
176 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATESEQERROR); 176 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR);
177 goto drop_unlock; 177 goto drop_unlock;
178 } 178 }
179 179
180 if (xfrm_state_check_expire(x)) { 180 if (xfrm_state_check_expire(x)) {
181 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEEXPIRED); 181 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEEXPIRED);
182 goto drop_unlock; 182 goto drop_unlock;
183 } 183 }
184 184
@@ -199,7 +199,7 @@ resume:
199 x->type->proto); 199 x->type->proto);
200 x->stats.integrity_failed++; 200 x->stats.integrity_failed++;
201 } 201 }
202 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEPROTOERROR); 202 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEPROTOERROR);
203 goto drop_unlock; 203 goto drop_unlock;
204 } 204 }
205 205
@@ -225,7 +225,7 @@ resume:
225 } 225 }
226 226
227 if (inner_mode->input(x, skb)) { 227 if (inner_mode->input(x, skb)) {
228 XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEMODEERROR); 228 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMODEERROR);
229 goto drop; 229 goto drop;
230 } 230 }
231 231
@@ -243,7 +243,7 @@ resume:
243 243
244 err = xfrm_parse_spi(skb, nexthdr, &spi, &seq); 244 err = xfrm_parse_spi(skb, nexthdr, &spi, &seq);
245 if (err < 0) { 245 if (err < 0) {
246 XFRM_INC_STATS(LINUX_MIB_XFRMINHDRERROR); 246 XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
247 goto drop; 247 goto drop;
248 } 248 }
249 } while (!err); 249 } while (!err);