summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-11-17 22:23:15 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-11-17 22:23:15 +0000
commitcd572bb1ded22a221156cd899f698fdc52cb4620 (patch)
tree529f2df9be87ee49219e8503690d127ce18c3f98
parentfd14d8382c552c6027388454164124b7bd31b4f7 (diff)
Fix printing of partner link aggregation group ID.
OK brad@
-rw-r--r--sbin/ifconfig/ifconfig.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index da76930676e..3e81addeaff 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.206 2008/09/30 13:11:48 deraadt Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.207 2008/11/17 22:23:14 mpf Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -4182,15 +4182,19 @@ trunk_status(void)
printf(" trunkdev %s", rp.rp_ifname);
putchar('\n');
if (ra.ra_proto == TRUNK_PROTO_LACP) {
+ char *act_mac = strdup(
+ ether_ntoa((struct ether_addr*)lp->actor_mac));
+ if (act_mac == NULL)
+ err(1, "strdup");
printf("\ttrunk id: [(%04X,%s,%04X,%04X,%04X),\n"
"\t\t (%04X,%s,%04X,%04X,%04X)]\n",
- lp->actor_prio,
- ether_ntoa((struct ether_addr*)lp->actor_mac),
+ lp->actor_prio, act_mac,
lp->actor_key, lp->actor_portprio, lp->actor_portno,
lp->partner_prio,
ether_ntoa((struct ether_addr*)lp->partner_mac),
lp->partner_key, lp->partner_portprio,
lp->partner_portno);
+ free(act_mac);
}
for (i = 0; i < ra.ra_ports; i++) {