Patchwork [v2,3/5] pktgen: display IPv4 address in human-readable format

login
register
mail settings
Submitter Amerigo Wang
Date Oct. 10, 2012, 3:48 a.m.
Message ID <1349840900-24138-3-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/190543/
State Accepted
Delegated to: David Miller
Headers show

Comments

Amerigo Wang - Oct. 10, 2012, 3:48 a.m.
It is weird to display IPv4 address in %x format, what's more,
IPv6 address is disaplayed in human-readable format too. So,
make it human-readable.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
 net/core/pktgen.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
David Miller - Oct. 11, 2012, 2:34 a.m.
From: Cong Wang <amwang@redhat.com>
Date: Wed, 10 Oct 2012 11:48:18 +0800

> It is weird to display IPv4 address in %x format, what's more,
> IPv6 address is disaplayed in human-readable format too. So,
> make it human-readable.
> 
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 98ee549..f9b4637 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -702,8 +702,8 @@  static int pktgen_if_show(struct seq_file *seq, void *v)
 				&pkt_dev->cur_in6_saddr,
 				&pkt_dev->cur_in6_daddr);
 	} else
-		seq_printf(seq, "     cur_saddr: 0x%x  cur_daddr: 0x%x\n",
-			   pkt_dev->cur_saddr, pkt_dev->cur_daddr);
+		seq_printf(seq, "     cur_saddr: %pI4  cur_daddr: %pI4\n",
+			   &pkt_dev->cur_saddr, &pkt_dev->cur_daddr);
 
 	seq_printf(seq, "     cur_udp_dst: %d  cur_udp_src: %d\n",
 		   pkt_dev->cur_udp_dst, pkt_dev->cur_udp_src);