]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: use mac2str() function utility to display mac address
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 1 Feb 2017 17:41:38 +0000 (18:41 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 1 Feb 2017 17:42:22 +0000 (18:42 +0100)
VNC uses the prefix API to handle mac string.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/rfapi/rfapi_vty.c

index f7c3773fd472ed7152e513ad6fce327fa46c3b63..f08ab98be37ab864eacb83494e79642179f5107b 100644 (file)
@@ -313,19 +313,7 @@ rfapiL2o2Qprefix (struct rfapi_l2address_option *l2o, struct prefix *pfx)
 char *
 rfapiEthAddr2Str (const struct ethaddr *ea, char *buf, int bufsize)
 {
-  int i;
-  char *p = buf;
-
-  assert (bufsize > (3 * ETHER_ADDR_LEN));
-
-  for (i = 0; i <= ETHER_ADDR_LEN; ++i)
-    {
-      sprintf (p, "%02x", ea->octet[i]);
-      if (i < (ETHER_ADDR_LEN - 1))
-        *(p + 2) = ':';
-      p += 3;
-    }
-  return buf;
+  return mac2str (ea->octet, buf, bufsize);
 }
 
 int