Commit ab141e37 authored by Tom Parkin's avatar Tom Parkin Committed by David S. Miller

l2tp: remove noisy logging, use appropriate log levels

l2tp_ppp in particular had a lot of log messages for tracing
[get|set]sockopt calls.  These aren't especially useful, so remove
these messages.

Several log messages flagging error conditions were logged using
l2tp_info: they're better off as l2tp_warn.
Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 12923365
...@@ -665,7 +665,7 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb, ...@@ -665,7 +665,7 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
/* Parse and check optional cookie */ /* Parse and check optional cookie */
if (session->peer_cookie_len > 0) { if (session->peer_cookie_len > 0) {
if (memcmp(ptr, &session->peer_cookie[0], session->peer_cookie_len)) { if (memcmp(ptr, &session->peer_cookie[0], session->peer_cookie_len)) {
l2tp_info(tunnel, L2TP_MSG_DATA, l2tp_warn(tunnel, L2TP_MSG_DATA,
"%s: cookie mismatch (%u/%u). Discarding.\n", "%s: cookie mismatch (%u/%u). Discarding.\n",
tunnel->name, tunnel->tunnel_id, tunnel->name, tunnel->tunnel_id,
session->session_id); session->session_id);
...@@ -835,7 +835,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb) ...@@ -835,7 +835,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)
/* Short packet? */ /* Short packet? */
if (!pskb_may_pull(skb, L2TP_HDR_SIZE_MAX)) { if (!pskb_may_pull(skb, L2TP_HDR_SIZE_MAX)) {
l2tp_info(tunnel, L2TP_MSG_DATA, l2tp_warn(tunnel, L2TP_MSG_DATA,
"%s: recv short packet (len=%d)\n", "%s: recv short packet (len=%d)\n",
tunnel->name, skb->len); tunnel->name, skb->len);
goto error; goto error;
...@@ -851,7 +851,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb) ...@@ -851,7 +851,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)
/* Check protocol version */ /* Check protocol version */
version = hdrflags & L2TP_HDR_VER_MASK; version = hdrflags & L2TP_HDR_VER_MASK;
if (version != tunnel->version) { if (version != tunnel->version) {
l2tp_info(tunnel, L2TP_MSG_DATA, l2tp_warn(tunnel, L2TP_MSG_DATA,
"%s: recv protocol version mismatch: got %d expected %d\n", "%s: recv protocol version mismatch: got %d expected %d\n",
tunnel->name, version, tunnel->version); tunnel->name, version, tunnel->version);
goto error; goto error;
...@@ -891,7 +891,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb) ...@@ -891,7 +891,7 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)
l2tp_session_dec_refcount(session); l2tp_session_dec_refcount(session);
/* Not found? Pass to userspace to deal with */ /* Not found? Pass to userspace to deal with */
l2tp_info(tunnel, L2TP_MSG_DATA, l2tp_warn(tunnel, L2TP_MSG_DATA,
"%s: no session found (%u/%u). Passing up.\n", "%s: no session found (%u/%u). Passing up.\n",
tunnel->name, tunnel_id, session_id); tunnel->name, tunnel_id, session_id);
goto error; goto error;
...@@ -1149,8 +1149,6 @@ static void l2tp_tunnel_destruct(struct sock *sk) ...@@ -1149,8 +1149,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
if (!tunnel) if (!tunnel)
goto end; goto end;
l2tp_info(tunnel, L2TP_MSG_CONTROL, "%s: closing...\n", tunnel->name);
/* Disable udp encapsulation */ /* Disable udp encapsulation */
switch (tunnel->encap) { switch (tunnel->encap) {
case L2TP_ENCAPTYPE_UDP: case L2TP_ENCAPTYPE_UDP:
...@@ -1209,9 +1207,6 @@ static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) ...@@ -1209,9 +1207,6 @@ static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
struct hlist_node *tmp; struct hlist_node *tmp;
struct l2tp_session *session; struct l2tp_session *session;
l2tp_info(tunnel, L2TP_MSG_CONTROL, "%s: closing all sessions...\n",
tunnel->name);
write_lock_bh(&tunnel->hlist_lock); write_lock_bh(&tunnel->hlist_lock);
tunnel->acpt_newsess = false; tunnel->acpt_newsess = false;
for (hash = 0; hash < L2TP_HASH_SIZE; hash++) { for (hash = 0; hash < L2TP_HASH_SIZE; hash++) {
...@@ -1219,9 +1214,6 @@ static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) ...@@ -1219,9 +1214,6 @@ static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
session = hlist_entry(walk, struct l2tp_session, hlist); session = hlist_entry(walk, struct l2tp_session, hlist);
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: closing session\n", session->name);
hlist_del_init(&session->hlist); hlist_del_init(&session->hlist);
if (test_and_set_bit(0, &session->dead)) if (test_and_set_bit(0, &session->dead))
......
...@@ -251,7 +251,7 @@ static void pppol2tp_recv(struct l2tp_session *session, struct sk_buff *skb, int ...@@ -251,7 +251,7 @@ static void pppol2tp_recv(struct l2tp_session *session, struct sk_buff *skb, int
no_sock: no_sock:
rcu_read_unlock(); rcu_read_unlock();
l2tp_info(session, L2TP_MSG_DATA, "%s: no socket\n", session->name); l2tp_warn(session, L2TP_MSG_DATA, "%s: no socket\n", session->name);
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -832,8 +832,6 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr, ...@@ -832,8 +832,6 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
drop_refcnt = false; drop_refcnt = false;
sk->sk_state = PPPOX_CONNECTED; sk->sk_state = PPPOX_CONNECTED;
l2tp_info(session, L2TP_MSG_CONTROL, "%s: created\n",
session->name);
end: end:
if (error) { if (error) {
...@@ -1150,8 +1148,6 @@ static int pppol2tp_tunnel_setsockopt(struct sock *sk, ...@@ -1150,8 +1148,6 @@ static int pppol2tp_tunnel_setsockopt(struct sock *sk,
switch (optname) { switch (optname) {
case PPPOL2TP_SO_DEBUG: case PPPOL2TP_SO_DEBUG:
tunnel->debug = val; tunnel->debug = val;
l2tp_info(tunnel, L2TP_MSG_CONTROL, "%s: set debug=%x\n",
tunnel->name, tunnel->debug);
break; break;
default: default:
...@@ -1177,9 +1173,6 @@ static int pppol2tp_session_setsockopt(struct sock *sk, ...@@ -1177,9 +1173,6 @@ static int pppol2tp_session_setsockopt(struct sock *sk,
break; break;
} }
session->recv_seq = !!val; session->recv_seq = !!val;
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: set recv_seq=%d\n",
session->name, session->recv_seq);
break; break;
case PPPOL2TP_SO_SENDSEQ: case PPPOL2TP_SO_SENDSEQ:
...@@ -1195,9 +1188,6 @@ static int pppol2tp_session_setsockopt(struct sock *sk, ...@@ -1195,9 +1188,6 @@ static int pppol2tp_session_setsockopt(struct sock *sk,
PPPOL2TP_L2TP_HDR_SIZE_NOSEQ; PPPOL2TP_L2TP_HDR_SIZE_NOSEQ;
} }
l2tp_session_set_header_len(session, session->tunnel->version); l2tp_session_set_header_len(session, session->tunnel->version);
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: set send_seq=%d\n",
session->name, session->send_seq);
break; break;
case PPPOL2TP_SO_LNSMODE: case PPPOL2TP_SO_LNSMODE:
...@@ -1206,22 +1196,14 @@ static int pppol2tp_session_setsockopt(struct sock *sk, ...@@ -1206,22 +1196,14 @@ static int pppol2tp_session_setsockopt(struct sock *sk,
break; break;
} }
session->lns_mode = !!val; session->lns_mode = !!val;
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: set lns_mode=%d\n",
session->name, session->lns_mode);
break; break;
case PPPOL2TP_SO_DEBUG: case PPPOL2TP_SO_DEBUG:
session->debug = val; session->debug = val;
l2tp_info(session, L2TP_MSG_CONTROL, "%s: set debug=%x\n",
session->name, session->debug);
break; break;
case PPPOL2TP_SO_REORDERTO: case PPPOL2TP_SO_REORDERTO:
session->reorder_timeout = msecs_to_jiffies(val); session->reorder_timeout = msecs_to_jiffies(val);
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: set reorder_timeout=%d\n",
session->name, session->reorder_timeout);
break; break;
default: default:
...@@ -1290,8 +1272,6 @@ static int pppol2tp_tunnel_getsockopt(struct sock *sk, ...@@ -1290,8 +1272,6 @@ static int pppol2tp_tunnel_getsockopt(struct sock *sk,
switch (optname) { switch (optname) {
case PPPOL2TP_SO_DEBUG: case PPPOL2TP_SO_DEBUG:
*val = tunnel->debug; *val = tunnel->debug;
l2tp_info(tunnel, L2TP_MSG_CONTROL, "%s: get debug=%x\n",
tunnel->name, tunnel->debug);
break; break;
default: default:
...@@ -1313,32 +1293,22 @@ static int pppol2tp_session_getsockopt(struct sock *sk, ...@@ -1313,32 +1293,22 @@ static int pppol2tp_session_getsockopt(struct sock *sk,
switch (optname) { switch (optname) {
case PPPOL2TP_SO_RECVSEQ: case PPPOL2TP_SO_RECVSEQ:
*val = session->recv_seq; *val = session->recv_seq;
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: get recv_seq=%d\n", session->name, *val);
break; break;
case PPPOL2TP_SO_SENDSEQ: case PPPOL2TP_SO_SENDSEQ:
*val = session->send_seq; *val = session->send_seq;
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: get send_seq=%d\n", session->name, *val);
break; break;
case PPPOL2TP_SO_LNSMODE: case PPPOL2TP_SO_LNSMODE:
*val = session->lns_mode; *val = session->lns_mode;
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: get lns_mode=%d\n", session->name, *val);
break; break;
case PPPOL2TP_SO_DEBUG: case PPPOL2TP_SO_DEBUG:
*val = session->debug; *val = session->debug;
l2tp_info(session, L2TP_MSG_CONTROL, "%s: get debug=%d\n",
session->name, *val);
break; break;
case PPPOL2TP_SO_REORDERTO: case PPPOL2TP_SO_REORDERTO:
*val = (int)jiffies_to_msecs(session->reorder_timeout); *val = (int)jiffies_to_msecs(session->reorder_timeout);
l2tp_info(session, L2TP_MSG_CONTROL,
"%s: get reorder_timeout=%d\n", session->name, *val);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment