Page MenuHomeFreeBSD

Selectively print "hwaddr" from ifconfig(8).
ClosedPublic

Authored by mjoras on Jul 29 2017, 1:42 AM.

Details

Summary

ifconfig(8) printing the hwaddr is only really useful if it differs from
the link layer address.

Test Plan
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ sudo ifconfig lagg0 laggport wlan0 laggport em0
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ ifconfig lagg0
lagg0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 44:85:00:b2:19:20
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: active
	groups: lagg 
	laggproto failover lagghash l2,l3,l4
	laggport: em0 flags=0<>
	laggport: wlan0 flags=5<MASTER,ACTIVE>
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=200080<VLAN_HWCSUM,RXCSUM_IPV6>
	ether 44:85:00:b2:19:20
	hwaddr 50:7b:9d:e6:36:41
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: no carrier
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 44:85:00:b2:19:20
	hwaddr 44:85:00:b2:19:20
	inet 192.168.2.122 netmask 0xffffff00 broadcast 192.168.2.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11a
	status: associated
	ssid Mordor_5GHz channel 40 (5200 MHz 11a) bssid 94:10:3e:0e:6b:8d
	regdomain FCC country US authmode WPA2/802.11i privacy ON
	deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit txpower 17 bmiss 10
	mcastrate 6 mgmtrate 6 scanvalid 60 wme roaming MANUAL
	groups: wlan 
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ ./ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 44:85:00:b2:19:20
	inet 192.168.2.122 netmask 0xffffff00 broadcast 192.168.2.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11a
	status: associated
	ssid Mordor_5GHz channel 40 (5200 MHz 11a) bssid 94:10:3e:0e:6b:8d
	regdomain FCC country US authmode WPA2/802.11i privacy ON
	deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit txpower 17 bmiss 10
	mcastrate 6 mgmtrate 6 scanvalid 60 wme roaming MANUAL
	groups: wlan 
mjoras at anomander in ~/g/f/i/s/ifconfig
↪ ./ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=200080<VLAN_HWCSUM,RXCSUM_IPV6>
	ether 44:85:00:b2:19:20
	hwaddr 50:7b:9d:e6:36:41
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: no carrier

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjoras created this revision.Jul 29 2017, 1:42 AM
rpokala accepted this revision.Jul 29 2017, 2:29 AM
This revision is now accepted and ready to land.Jul 29 2017, 2:29 AM
rstone accepted this revision.Aug 4 2017, 8:51 PM
This revision was automatically updated to reflect the committed changes.