projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c0ec37
)
l2tp: check socket address type in l2tp_dfs_seq_tunnel_show
author
Tom Parkin
<tparkin@katalix.com>
Thu, 23 Jul 2020 11:29:52 +0000
(12:29 +0100)
committer
David S. Miller
<davem@davemloft.net>
Thu, 23 Jul 2020 18:54:40 +0000
(11:54 -0700)
checkpatch warns about indentation and brace balancing around the
conditionally compiled code for AF_INET6 support in
l2tp_dfs_seq_tunnel_show.
By adding another check on the socket address type we can make the code
more readable while removing the checkpatch warning.
Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_debugfs.c
patch
|
blob
|
history
diff --git
a/net/l2tp/l2tp_debugfs.c
b/net/l2tp/l2tp_debugfs.c
index
117a669
..
72ba83a
100644
(file)
--- a/
net/l2tp/l2tp_debugfs.c
+++ b/
net/l2tp/l2tp_debugfs.c
@@
-146,10
+146,12
@@
static void l2tp_dfs_seq_tunnel_show(struct seq_file *m, void *v)
seq_printf(m, " from %pI6c to %pI6c\n",
&np->saddr, &tunnel->sock->sk_v6_daddr);
- }
else
+ }
#endif
- seq_printf(m, " from %pI4 to %pI4\n",
- &inet->inet_saddr, &inet->inet_daddr);
+ if (tunnel->sock->sk_family == AF_INET)
+ seq_printf(m, " from %pI4 to %pI4\n",
+ &inet->inet_saddr, &inet->inet_daddr);
+
if (tunnel->encap == L2TP_ENCAPTYPE_UDP)
seq_printf(m, " source port %hu, dest port %hu\n",
ntohs(inet->inet_sport), ntohs(inet->inet_dport));