Red Hat Bugzilla – Full Text Bug Listing
|Summary:||NetworkManager adds hostname to localhost entry in /etc/hosts but shouldn't|
|Product:||[Fedora] Fedora||Reporter:||Peter Backes <rtc>|
|Component:||NetworkManager||Assignee:||Dan Williams <dcbw>|
|Status:||CLOSED DUPLICATE||QA Contact:||Fedora Extras Quality Assurance <extras-qa>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2011-02-25 14:09:02 EST||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description Peter Backes 2010-12-02 16:04:27 EST
Description of problem: After running NetworkManager, the hostname of my machine has been added as a new name for the loopback IP (127.0.0.1) in /etc/hosts, despite the fact that I already have an entry that assigns the hostname to some specific IP address. It does that because of the check ip4_addr && ip4_addr_matches (*line, ip4_addr) in nm_policy_get_etc_hosts(). My ip4_addr is 192.168.100.100 (eth0) but I have 192.168.1.254 as a secondary IP address for that device (eth0:0). That secondary IP address is mapped to my hostname (helen) in /etc/hosts (see below). Why can't it just leave the ipv4 stuff as is if it finds the hostname somewhere? Does it really have to check if it's a line for ip4_addr? Let me quote the commit message of http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=f6c383ff14412ea264fa8740dec84f92a89bd385 "If the user has already mapped the hostname to some other address, assume the user knows what they are doing (since they probably do) and leave that mapping alone" That is a true statement indeed! This really caused some annoyance, since all my outgoing email was sent as firstname.lastname@example.org. Version-Release number of selected component (if applicable): NetworkManager-0.8.1-10.git20100831.fc14.i686 How reproducible: always Steps to Reproduce: 1. have configuration as described above 2. run NetworkManager 3. look at /etc/hosts Actual results: helen has been added as an additional hostname for the loopback IP: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 helen localhost.localdomain localhost localhost4 ::1 helen localhost6.localdomain6 localhost6 192.168.1.254 helen.PLASMA.Xg8.DE helen loghost Expected results: hosts is essentially left unmodified and helen not added as an additional hostname for the loopback IP: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost localhost4 ::1 localhost6.localdomain6 localhost6 192.168.1.254 helen.PLASMA.Xg8.DE helen loghost Additional info: This is similar to the already fixed bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567411 but the ip4_addr_matches (*line, ip4_addr) seems to have been introduced after that fix.
Comment 1 Peter Backes 2010-12-02 21:06:16 EST
BTW, in case it's not clear from what I wrote: I think it shouldn't add the hostname to the ipv6 ::1 either if there is a ipv4 entry (but no ipv6 entry) that contains it. Since having the hostname on ::1 causes the same breakage (mail system using localhost.localdomain; hostname -f not working properly etc.). It shouldn't change the above /etc/hosts at all IMO if hostname is helen.