Not all drivers will return errors when even when they don't provide
the GPERMADDR ethtool call; sometimes you'll get 00:00:00:00:00:00
which is clearly not right. In this case, fall back to the current
HW address just like if the ethtool GPERMADDR call failed.
- Just use a byte array to old MAC addresses so we don't need to
use .ether_addr_octet everywhere
- Consolidate setting the current MAC address into one location
- Make sure that if the GPERMADDR call fails we use the current MAC
(this wasn't done for wired devices)
- Make log messages consistent
priv->ip_iface gets destroyed in vpn_cleanup() when the class
signal handler handles FAILED/DISCONNECTED, but the dispatcher
is only called *after* that, so it gets a NULL ip_iface. Fix that
so that the dispatcher always gets the tunnel interface for
vpn-up and vpn-down.
Otherwise glibc will count the localhost IPv6 (::1) mapping as
resolving to the IPv4 localhost mapping as well, so this:
127.0.0.1 localhost.localdomain localhost
::1 foobar localhost6.localdomain6 localhost6
192.168.1.2 fooar
causes a lookup of 'foobar' (or even just 'ping foobar') to resolve
to 127.0.0.1, even though the hostname is *not* listed on the
IPv4 localhost line. Apparently glibc just looks for the hostname
on any IPv4 or IPv6 localhost line.
We need to ensure that even if you don't have a routable IP address
for one of [IPv4, IPv6] that the hostname resolves to the localhost
address for that IP version, otherwise lots of stuff starts
breaking. But for the IP versions that you do have a routable IP
address, we want the hostname to map to that IP address too.
Add the current domain name (from the hostname) to the searches list.
The bug report is that when the hostname is set to something like
'dcbw.foobar.com' (ie an FQDN) that pinging 'dcbw' doesn't work
because the resolver doesn't have anything to append to 'dcbw' when
looking it up.
This commit implements MAC cloning feature in NetworkManager. To support that,
'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless
interfaces. The permanent MAC address is obtained when creating the device, and
is used for 'locking' connections to the device. If a cloned MAC is specified
in connection to be activated, the MAC is set to the interface in stage1. While
disconecting, the permanent MAC is set back to the interface.
Instead of always mapping the current hostname to 127.0.0.1 or
whatever the user mapped it to manually, make sure the hostname
maps to the default device's IPv4 and IPv6 address if there's
a default device.
This helps out services that do a lookup on the machine hostname
to determine the IP address, which while a broken behavior (since
there are too many edge-cases) is pretty wide-spread and thus
we should support it.
In preparation for updating /etc/hosts to assign the current hostname
to the current IP address to allow programs that (somewhat incorrectly)
do DNS lookups on the machine's current hostname to find out its
IP address.
dnsmasq may read from its default config file location, which if that
location is a valid config file, it will combine with the options here
and cause undesirable side-effects. Like sending bogus IP addresses
as the gateway or whatever. So give dnsmasq a bogus config file
location to avoid screwing up the configuration we're passing to it.
Default to 'not allowed', distros that need backwards compatibility
can flip this to 'yes' if they need to. At this point, only power
management scripts should call these functions.