]> 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>
Tue, 14 Feb 2017 12:58:59 +0000 (13:58 +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 dbc2a430bc9de0bb55a35b2c87717ab930ec8897..997f1d3c3423d664dfff9c23ce19a41f08f20011 100644 (file)
@@ -314,19 +314,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