Skip to content

Commit

Permalink
l2tp: show IPv6 addresses in l2tp debugfs file
Browse files Browse the repository at this point in the history
If an L2TP tunnel uses IPv6, make sure the l2tp debugfs file shows the
IPv6 address correctly.

Signed-off-by: Chris Elston <celston@katalix.com>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chris Elston authored and David S. Miller committed May 1, 2012
1 parent b79585f commit 2121c3f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/l2tp/l2tp_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ static void l2tp_dfs_seq_tunnel_show(struct seq_file *m, void *v)
seq_printf(m, "\nTUNNEL %u peer %u", tunnel->tunnel_id, tunnel->peer_tunnel_id);
if (tunnel->sock) {
struct inet_sock *inet = inet_sk(tunnel->sock);

#if IS_ENABLED(CONFIG_IPV6)
if (tunnel->sock->sk_family == AF_INET6) {
struct ipv6_pinfo *np = inet6_sk(tunnel->sock);
seq_printf(m, " from %pI6c to %pI6c\n",
&np->saddr, &np->daddr);
} else
#endif
seq_printf(m, " from %pI4 to %pI4\n",
&inet->inet_saddr, &inet->inet_daddr);
if (tunnel->encap == L2TP_ENCAPTYPE_UDP)
Expand Down

0 comments on commit 2121c3f

Please sign in to comment.