diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index b053ac795275..1f535e315188 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1619,7 +1619,8 @@ void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo) | |||
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | /* ------------------------------------------------------------------------ */ | 1621 | /* ------------------------------------------------------------------------ */ |
1622 | static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket) | 1622 | static void udp4_format_sock(struct sock *sp, struct seq_file *f, |
1623 | int bucket, int *len) | ||
1623 | { | 1624 | { |
1624 | struct inet_sock *inet = inet_sk(sp); | 1625 | struct inet_sock *inet = inet_sk(sp); |
1625 | __be32 dest = inet->daddr; | 1626 | __be32 dest = inet->daddr; |
@@ -1627,13 +1628,13 @@ static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket) | |||
1627 | __u16 destp = ntohs(inet->dport); | 1628 | __u16 destp = ntohs(inet->dport); |
1628 | __u16 srcp = ntohs(inet->sport); | 1629 | __u16 srcp = ntohs(inet->sport); |
1629 | 1630 | ||
1630 | sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X" | 1631 | seq_printf(f, "%4d: %08X:%04X %08X:%04X" |
1631 | " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p", | 1632 | " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p%n", |
1632 | bucket, src, srcp, dest, destp, sp->sk_state, | 1633 | bucket, src, srcp, dest, destp, sp->sk_state, |
1633 | atomic_read(&sp->sk_wmem_alloc), | 1634 | atomic_read(&sp->sk_wmem_alloc), |
1634 | atomic_read(&sp->sk_rmem_alloc), | 1635 | atomic_read(&sp->sk_rmem_alloc), |
1635 | 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), | 1636 | 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), |
1636 | atomic_read(&sp->sk_refcnt), sp); | 1637 | atomic_read(&sp->sk_refcnt), sp, len); |
1637 | } | 1638 | } |
1638 | 1639 | ||
1639 | int udp4_seq_show(struct seq_file *seq, void *v) | 1640 | int udp4_seq_show(struct seq_file *seq, void *v) |
@@ -1644,11 +1645,11 @@ int udp4_seq_show(struct seq_file *seq, void *v) | |||
1644 | "rx_queue tr tm->when retrnsmt uid timeout " | 1645 | "rx_queue tr tm->when retrnsmt uid timeout " |
1645 | "inode"); | 1646 | "inode"); |
1646 | else { | 1647 | else { |
1647 | char tmpbuf[129]; | ||
1648 | struct udp_iter_state *state = seq->private; | 1648 | struct udp_iter_state *state = seq->private; |
1649 | int len; | ||
1649 | 1650 | ||
1650 | udp4_format_sock(v, tmpbuf, state->bucket); | 1651 | udp4_format_sock(v, seq, state->bucket, &len); |
1651 | seq_printf(seq, "%-127s\n", tmpbuf); | 1652 | seq_printf(seq, "%*s\n", 127 - len ,""); |
1652 | } | 1653 | } |
1653 | return 0; | 1654 | return 0; |
1654 | } | 1655 | } |