Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2009 13:40:13 GMT
From:      Artis Caune <Artis.Caune@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/136994: [patch] ifconfig: print carp mac address
Message-ID:  <200907221340.n6MDeDbN090473@www.freebsd.org>
Resent-Message-ID: <200907221350.n6MDo560053527@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         136994
>Category:       bin
>Synopsis:       [patch] ifconfig: print carp mac address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 22 13:50:05 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Artis Caune
>Release:        current
>Organization:
>Environment:
FreeBSD 8.0-BETA2 #0 r195800: Tue Jul 21 15:01:41 EEST 2009     root@builder:/usr/obj/usr/src/sys/FREEBSD 

>Description:
It would be nice to see mac address of carp interfaces in ifconfig output.

carp0: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
	ether 00:00:5e:00:01:fa
	carp: MASTER vhid 250 advbase 1 advskew 100

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sbin/ifconfig/af_link.c
===================================================================
--- sbin/ifconfig/af_link.c	(revision 195818)
+++ sbin/ifconfig/af_link.c	(working copy)
@@ -57,6 +57,10 @@
 	/* XXX no const 'cuz LLADDR is defined wrong */
 	struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr;
 
+	if (sdl != NULL && sdl->sdl_type == IFT_CARP)
+		printf("\tether %s\n",
+		    ether_ntoa((struct ether_addr *)LLADDR(sdl)));
+
 	if (sdl != NULL && sdl->sdl_alen > 0) {
 		if (sdl->sdl_type == IFT_ETHER &&
 		    sdl->sdl_alen == ETHER_ADDR_LEN)


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907221340.n6MDeDbN090473>