aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/pktgen.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 17:59:30 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:51:42 -0700
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /net/core/pktgen.c
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff)
downloadkernel_samsung_crespo-0795af5729b18218767fab27c44b1384f72dc9ad.zip
kernel_samsung_crespo-0795af5729b18218767fab27c44b1384f72dc9ad.tar.gz
kernel_samsung_crespo-0795af5729b18218767fab27c44b1384f72dc9ad.tar.bz2
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r--net/core/pktgen.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 94e42be..f07bd59 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -599,11 +599,11 @@ static const struct file_operations pktgen_fops = {
static int pktgen_if_show(struct seq_file *seq, void *v)
{
- int i;
struct pktgen_dev *pkt_dev = seq->private;
__u64 sa;
__u64 stopped;
__u64 now = getCurUs();
+ DECLARE_MAC_BUF(mac);
seq_printf(seq,
"Params: count %llu min_pkt_size: %u max_pkt_size: %u\n",
@@ -648,19 +648,12 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
seq_puts(seq, " src_mac: ");
- if (is_zero_ether_addr(pkt_dev->src_mac))
- for (i = 0; i < 6; i++)
- seq_printf(seq, "%02X%s", pkt_dev->odev->dev_addr[i],
- i == 5 ? " " : ":");
- else
- for (i = 0; i < 6; i++)
- seq_printf(seq, "%02X%s", pkt_dev->src_mac[i],
- i == 5 ? " " : ":");
+ seq_printf(seq, "%s ",
+ print_mac(mac, is_zero_ether_addr(pkt_dev->src_mac) ?
+ pkt_dev->odev->dev_addr : pkt_dev->src_mac));
seq_printf(seq, "dst_mac: ");
- for (i = 0; i < 6; i++)
- seq_printf(seq, "%02X%s", pkt_dev->dst_mac[i],
- i == 5 ? "\n" : ":");
+ seq_printf(seq, "%s\n", print_mac(mac, pkt_dev->dst_mac));
seq_printf(seq,
" udp_src_min: %d udp_src_max: %d udp_dst_min: %d udp_dst_max: %d\n",