pifconfig crashes when tries to print info about an interface with no IPv4 address assigned.
For example, I have two interfaces, one without IPv4 address:
$ ip addr show dev lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
$ ip addr show dev enp0s31f6
2: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 50:7b:9d:e6:53:38 brd ff:ff:ff:ff:ff:ff
pifconfig crashes when it comes to printing info about the second interface:
pifconfig
crashes when tries to print info about an interface with no IPv4 address assigned.For example, I have two interfaces, one without IPv4 address:
pifconfig
crashes when it comes to printing info about the second interface:After this change, it omits info about IPV4 address/network/broadcast when it cannot get it from OS: