aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_ip.c
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2012-04-29 17:48:48 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-01 09:30:54 -0400
commitc8657fd50a7553a4a9cb4b04cdc11419c9d93d9b (patch)
tree769f1fe102c1ce94c113b728dc1ce541bee5eb00 /net/l2tp/l2tp_ip.c
parentde3c7a1827fa144917270eb66956930012ddae52 (diff)
l2tp: remove unused stats from l2tp_ip socket
The l2tp_ip socket currently maintains packet/byte stats in its private socket structure. But these counters aren't exposed to userspace and so serve no purpose. The counters were also smp-unsafe. So this patch just gets rid of the stats. While here, change a couple of internal __u32 variables to u32. Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_ip.c')
-rw-r--r--net/l2tp/l2tp_ip.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 516259284846..adefe5225dca 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -32,15 +32,8 @@ struct l2tp_ip_sock {
32 /* inet_sock has to be the first member of l2tp_ip_sock */ 32 /* inet_sock has to be the first member of l2tp_ip_sock */
33 struct inet_sock inet; 33 struct inet_sock inet;
34 34
35 __u32 conn_id; 35 u32 conn_id;
36 __u32 peer_conn_id; 36 u32 peer_conn_id;
37
38 __u64 tx_packets;
39 __u64 tx_bytes;
40 __u64 tx_errors;
41 __u64 rx_packets;
42 __u64 rx_bytes;
43 __u64 rx_errors;
44}; 37};
45 38
46static DEFINE_RWLOCK(l2tp_ip_lock); 39static DEFINE_RWLOCK(l2tp_ip_lock);
@@ -298,7 +291,6 @@ out_in_use:
298static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) 291static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
299{ 292{
300 struct sockaddr_l2tpip *lsa = (struct sockaddr_l2tpip *) uaddr; 293 struct sockaddr_l2tpip *lsa = (struct sockaddr_l2tpip *) uaddr;
301 struct inet_sock *inet = inet_sk(sk);
302 int rc; 294 int rc;
303 295
304 if (addr_len < sizeof(*lsa)) 296 if (addr_len < sizeof(*lsa))
@@ -374,7 +366,6 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
374{ 366{
375 struct sk_buff *skb; 367 struct sk_buff *skb;
376 int rc; 368 int rc;
377 struct l2tp_ip_sock *lsa = l2tp_ip_sk(sk);
378 struct inet_sock *inet = inet_sk(sk); 369 struct inet_sock *inet = inet_sk(sk);
379 struct rtable *rt = NULL; 370 struct rtable *rt = NULL;
380 struct flowi4 *fl4; 371 struct flowi4 *fl4;
@@ -473,14 +464,8 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
473 rcu_read_unlock(); 464 rcu_read_unlock();
474 465
475error: 466error:
476 /* Update stats */ 467 if (rc >= 0)
477 if (rc >= 0) {
478 lsa->tx_packets++;
479 lsa->tx_bytes += len;
480 rc = len; 468 rc = len;
481 } else {
482 lsa->tx_errors++;
483 }
484 469
485out: 470out:
486 release_sock(sk); 471 release_sock(sk);
@@ -498,7 +483,6 @@ static int l2tp_ip_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
498 size_t len, int noblock, int flags, int *addr_len) 483 size_t len, int noblock, int flags, int *addr_len)
499{ 484{
500 struct inet_sock *inet = inet_sk(sk); 485 struct inet_sock *inet = inet_sk(sk);
501 struct l2tp_ip_sock *lsk = l2tp_ip_sk(sk);
502 size_t copied = 0; 486 size_t copied = 0;
503 int err = -EOPNOTSUPP; 487 int err = -EOPNOTSUPP;
504 struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; 488 struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
@@ -540,15 +524,7 @@ static int l2tp_ip_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
540done: 524done:
541 skb_free_datagram(sk, skb); 525 skb_free_datagram(sk, skb);
542out: 526out:
543 if (err) { 527 return err ? err : copied;
544 lsk->rx_errors++;
545 return err;
546 }
547
548 lsk->rx_packets++;
549 lsk->rx_bytes += copied;
550
551 return copied;
552} 528}
553 529
554static struct proto l2tp_ip_prot = { 530static struct proto l2tp_ip_prot = {