summaryrefslogtreecommitdiff
path: root/examples/ipv4_multicast
diff options
context:
space:
mode:
authorCunming Liang <cunming.liang@intel.com>2014-11-12 14:24:32 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-11-13 00:48:16 +0100
commitec3d82db2dc13d3b96b7d97801d85dcbaaa1d1cb (patch)
treef6f83d4f8bd2d1190349dc95586bf01db446d71d /examples/ipv4_multicast
parent90924caf0831906ceac6b450048fd822659e22d3 (diff)
downloaddpdk-ec3d82db2dc13d3b96b7d97801d85dcbaaa1d1cb.zip
dpdk-ec3d82db2dc13d3b96b7d97801d85dcbaaa1d1cb.tar.gz
dpdk-ec3d82db2dc13d3b96b7d97801d85dcbaaa1d1cb.tar.xz
ether: new function to format mac address
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Diffstat (limited to 'examples/ipv4_multicast')
-rw-r--r--examples/ipv4_multicast/main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index de5e6be..590d11a 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -586,13 +586,9 @@ parse_args(int argc, char **argv)
static void
print_ethaddr(const char *name, struct ether_addr *eth_addr)
{
- printf("%s%02X:%02X:%02X:%02X:%02X:%02X", name,
- eth_addr->addr_bytes[0],
- eth_addr->addr_bytes[1],
- eth_addr->addr_bytes[2],
- eth_addr->addr_bytes[3],
- eth_addr->addr_bytes[4],
- eth_addr->addr_bytes[5]);
+ char buf[ETHER_ADDR_FMT_SIZE];
+ ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
+ printf("%s%s", name, buf);
}
static int