mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
l2tp: check socket address type in l2tp_dfs_seq_tunnel_show
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>
This commit is contained in:
parent
6c0ec37b82
commit
26d9a27106
1 changed files with 5 additions and 3 deletions
|
@ -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",
|
seq_printf(m, " from %pI6c to %pI6c\n",
|
||||||
&np->saddr, &tunnel->sock->sk_v6_daddr);
|
&np->saddr, &tunnel->sock->sk_v6_daddr);
|
||||||
} else
|
}
|
||||||
#endif
|
#endif
|
||||||
seq_printf(m, " from %pI4 to %pI4\n",
|
if (tunnel->sock->sk_family == AF_INET)
|
||||||
&inet->inet_saddr, &inet->inet_daddr);
|
seq_printf(m, " from %pI4 to %pI4\n",
|
||||||
|
&inet->inet_saddr, &inet->inet_daddr);
|
||||||
|
|
||||||
if (tunnel->encap == L2TP_ENCAPTYPE_UDP)
|
if (tunnel->encap == L2TP_ENCAPTYPE_UDP)
|
||||||
seq_printf(m, " source port %hu, dest port %hu\n",
|
seq_printf(m, " source port %hu, dest port %hu\n",
|
||||||
ntohs(inet->inet_sport), ntohs(inet->inet_dport));
|
ntohs(inet->inet_sport), ntohs(inet->inet_dport));
|
||||||
|
|
Loading…
Reference in a new issue