aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-06 04:47:55 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:30:36 -0400
commitb01a24078fa3fc4f0f447d1306ce5adc495ead86 (patch)
tree6949f590c81e2c1ce193b1bdaec68a60e9842879 /net/sctp/input.c
parentbb2db45b5495455ec7580315029184550709f4a2 (diff)
sctp: Make the mib per network namespace
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index c9a0449bde5..530830151f0 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -83,7 +83,7 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb);
83 83
84 84
85/* Calculate the SCTP checksum of an SCTP packet. */ 85/* Calculate the SCTP checksum of an SCTP packet. */
86static inline int sctp_rcv_checksum(struct sk_buff *skb) 86static inline int sctp_rcv_checksum(struct net *net, struct sk_buff *skb)
87{ 87{
88 struct sctphdr *sh = sctp_hdr(skb); 88 struct sctphdr *sh = sctp_hdr(skb);
89 __le32 cmp = sh->checksum; 89 __le32 cmp = sh->checksum;
@@ -99,7 +99,7 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
99 99
100 if (val != cmp) { 100 if (val != cmp) {
101 /* CRC failure, dump it. */ 101 /* CRC failure, dump it. */
102 SCTP_INC_STATS_BH(SCTP_MIB_CHECKSUMERRORS); 102 SCTP_INC_STATS_BH(net, SCTP_MIB_CHECKSUMERRORS);
103 return -1; 103 return -1;
104 } 104 }
105 return 0; 105 return 0;
@@ -137,7 +137,7 @@ int sctp_rcv(struct sk_buff *skb)
137 if (skb->pkt_type!=PACKET_HOST) 137 if (skb->pkt_type!=PACKET_HOST)
138 goto discard_it; 138 goto discard_it;
139 139
140 SCTP_INC_STATS_BH(SCTP_MIB_INSCTPPACKS); 140 SCTP_INC_STATS_BH(net, SCTP_MIB_INSCTPPACKS);
141 141
142 if (skb_linearize(skb)) 142 if (skb_linearize(skb))
143 goto discard_it; 143 goto discard_it;
@@ -149,7 +149,7 @@ int sctp_rcv(struct sk_buff *skb)
149 if (skb->len < sizeof(struct sctphdr)) 149 if (skb->len < sizeof(struct sctphdr))
150 goto discard_it; 150 goto discard_it;
151 if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) && 151 if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
152 sctp_rcv_checksum(skb) < 0) 152 sctp_rcv_checksum(net, skb) < 0)
153 goto discard_it; 153 goto discard_it;
154 154
155 skb_pull(skb, sizeof(struct sctphdr)); 155 skb_pull(skb, sizeof(struct sctphdr));
@@ -220,7 +220,7 @@ int sctp_rcv(struct sk_buff *skb)
220 */ 220 */
221 if (!asoc) { 221 if (!asoc) {
222 if (sctp_rcv_ootb(skb)) { 222 if (sctp_rcv_ootb(skb)) {
223 SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES); 223 SCTP_INC_STATS_BH(net, SCTP_MIB_OUTOFBLUES);
224 goto discard_release; 224 goto discard_release;
225 } 225 }
226 } 226 }
@@ -276,9 +276,9 @@ int sctp_rcv(struct sk_buff *skb)
276 skb = NULL; /* sctp_chunk_free already freed the skb */ 276 skb = NULL; /* sctp_chunk_free already freed the skb */
277 goto discard_release; 277 goto discard_release;
278 } 278 }
279 SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG); 279 SCTP_INC_STATS_BH(net, SCTP_MIB_IN_PKT_BACKLOG);
280 } else { 280 } else {
281 SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_SOFTIRQ); 281 SCTP_INC_STATS_BH(net, SCTP_MIB_IN_PKT_SOFTIRQ);
282 sctp_inq_push(&chunk->rcvr->inqueue, chunk); 282 sctp_inq_push(&chunk->rcvr->inqueue, chunk);
283 } 283 }
284 284
@@ -293,7 +293,7 @@ int sctp_rcv(struct sk_buff *skb)
293 return 0; 293 return 0;
294 294
295discard_it: 295discard_it:
296 SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_DISCARDS); 296 SCTP_INC_STATS_BH(net, SCTP_MIB_IN_PKT_DISCARDS);
297 kfree_skb(skb); 297 kfree_skb(skb);
298 return 0; 298 return 0;
299 299
@@ -543,7 +543,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
543 * servers this needs to be solved differently. 543 * servers this needs to be solved differently.
544 */ 544 */
545 if (sock_owned_by_user(sk)) 545 if (sock_owned_by_user(sk))
546 NET_INC_STATS_BH(&init_net, LINUX_MIB_LOCKDROPPEDICMPS); 546 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
547 547
548 *app = asoc; 548 *app = asoc;
549 *tpp = transport; 549 *tpp = transport;
@@ -593,7 +593,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
593 struct net *net = dev_net(skb->dev); 593 struct net *net = dev_net(skb->dev);
594 594
595 if (skb->len < ihlen + 8) { 595 if (skb->len < ihlen + 8) {
596 ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS); 596 ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
597 return; 597 return;
598 } 598 }
599 599
@@ -607,7 +607,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
607 skb->network_header = saveip; 607 skb->network_header = saveip;
608 skb->transport_header = savesctp; 608 skb->transport_header = savesctp;
609 if (!sk) { 609 if (!sk) {
610 ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS); 610 ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
611 return; 611 return;
612 } 612 }
613 /* Warning: The sock lock is held. Remember to call 613 /* Warning: The sock lock is held. Remember to call