Bug 174817 - NM mishandles multiple domain-name-servers, /etc/resolv.conf
NM mishandles multiple domain-name-servers, /etc/resolv.conf
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
rawhide
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Christopher Aillon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-02 09:57 EST by Tom London
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-20 13:03:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom London 2005-12-02 09:57:33 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051129 Fedora/1.5-1 Firefox/1.5

Description of problem:
Connected to linksys router serving as DHCP server, I get the following lease:

lease {
  interface "eth0";
  fixed-address 192.168.1.101;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 204.127.198.4,63.240.76.4;
  option dhcp-server-identifier 192.168.1.1;
  option domain-name "hsd1.ca.comcast.net.";
  renew 6 2005/12/3 01:16:42;
  rebind 6 2005/12/3 11:45:42;
  expire 6 2005/12/3 14:45:42;
}

The following is in /etc/resolv.conf:
# generated by NetworkManager, do not edit!

search hsd1.ca.comcast.net.


nameserver 204.127.198.4
nameserver 204.127.198.4

Notice that the first DNS server is duplicated in second line, even though the correct server address is provided in lease.

Version-Release number of selected component (if applicable):
NetworkManager-0.5.1-4

How reproducible:
Always

Steps to Reproduce:
1. boot, login, let NM do its magic
2. 'cat /etc/resolv.conf'
3.
  

Additional info:
Comment 1 Tom London 2006-01-19 13:11:11 EST
Still 'broken' in NetworkManager-0.5.1-5.1.

Below are lease file and resolv.conf:

lease {
  interface "eth0";
  fixed-address 10.10.4.5;
  option subnet-mask 255.255.0.0;
  option dhcp-lease-time 604800;
  option routers 10.10.2.2;
  option dhcp-message-type 5;
  option dhcp-server-identifier 10.10.2.11;
  option domain-name-servers 10.10.2.102,10.10.2.11,10.10.2.118;
  option dhcp-renewal-time 302400;
  option dhcp-rebinding-time 529200;
  option domain-name "doongo.com";
  renew 0 2006/1/22 19:38:42;
  rebind 3 2006/1/25 20:29:27;
  expire 4 2006/1/26 17:29:27;
}


# generated by NetworkManager, do not edit!

search doongo.com


nameserver 10.10.2.102
nameserver 10.10.2.102
nameserver 10.10.2.102




Comment 2 Tom London 2006-01-19 13:44:14 EST
Poked a bit....

in the file nm-named-manager.c, in the function compute_nameservers(), looks
like the loop is not 'using' the loop index:

Should
                addr.s_addr = nm_ip4_config_get_nameserver (config, 0);
be
                addr.s_addr = nm_ip4_config_get_nameserver (config, i);

Here's a 'patch' (from the gnome tarball):
--- nm-named-manager.c  2005-09-28 07:42:57.000000000 -0700
+++ new.c       2006-01-19 10:45:29.000000000 -0800
@@ -301,7 +301,7 @@
                if (!str)
                        str = g_string_new ("");

-               addr.s_addr = nm_ip4_config_get_nameserver (config, 0);
+               addr.s_addr = nm_ip4_config_get_nameserver (config, i);
                buf = g_malloc0 (ADDR_BUF_LEN);
                inet_ntop (AF_INET, &addr, buf, ADDR_BUF_LEN);



Comment 3 Tom London 2006-01-20 13:03:38 EST
I checked upstream, and this is reported fixed in CVS.

Not sure how to 'close' this.  UPSTREAM?

Note You need to log in before you can comment on or make changes to this bug.