Page MenuHomeFreeBSD

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

Authored by mjoras on Jul 29 2017, 1:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 30 2024, 1:06 PM
Unknown Object (File)
Sep 28 2024, 1:14 PM
Unknown Object (File)
Sep 28 2024, 6:22 AM
Unknown Object (File)
Sep 28 2024, 12:22 AM
Unknown Object (File)
Sep 27 2024, 6:58 PM
Unknown Object (File)
Sep 27 2024, 5:00 PM
Unknown Object (File)
Sep 26 2024, 1:14 AM
Unknown Object (File)
Sep 8 2024, 5:11 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable