summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2015-12-07 15:00:16 -0800
committerBen Pfaff <blp@ovn.org>2015-12-15 18:00:18 -0800
commitb0d390e5fd65bc5b83e91b6e9970e069f66f77a5 (patch)
tree2a131d0902876c43af833f882ee639090fd102e3 /vswitchd
parent1f632fff5e88abe28f9a8642c318d8927e51ea1e (diff)
downloadopenvswitch-b0d390e5fd65bc5b83e91b6e9970e069f66f77a5.tar.gz
packets: New macro ETH_ADDR_STRLEN.
An upcoming commit will introduce another user. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b966d9222..af103523f 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2220,9 +2220,10 @@ iface_refresh_netdev_status(struct iface *iface)
error = netdev_get_etheraddr(iface->netdev, &mac);
if (!error) {
- char mac_string[32];
+ char mac_string[ETH_ADDR_STRLEN + 1];
- sprintf(mac_string, ETH_ADDR_FMT, ETH_ADDR_ARGS(mac));
+ snprintf(mac_string, sizeof mac_string,
+ ETH_ADDR_FMT, ETH_ADDR_ARGS(mac));
ovsrec_interface_set_mac_in_use(iface->cfg, mac_string);
} else {
ovsrec_interface_set_mac_in_use(iface->cfg, NULL);