dhcpcd produces incorrect /etc/resolv.conf

Bug #2026405 reported by Takakazu Satoh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

Package: dhcpcd5 1:8.1.2-1+rpt9 armhf

How to reproduce the bug:

Write the following static eth0 setting in /etc/dhcpcd.conf

interface eth0
static ip_address=192.168.99.99/24
static routers=192.168.99.1
static domain_name_servers=192.168.99.53
static domain_name=home.arpa

dhcpcd updates /etc/resolv.conf as follows:

   # Generated by resolvconf
   domain home.arpa

which should be

   # Generated by resolvconf
   domain home.arpa
   nameserver 192.168.99.53

Possible Workaround:
Specify domain_name before domain_name_servers, i.e.

interface eth0
static ip_address=192.168.99.99/24
static routers=192.168.99.1
static domain_name=home.arpa
static domain_name_servers=192.168.99.53

In my environment, this produces the desired resolve.conf

I may be wrong but I believe this bug is caused by incorrect identifier
comparison in src/script.c.
The following patch seems to fix the problem but is not tested extensively.

--- script.c-dist 2019-01-22 23:53:45.000000000 +0900
+++ script.c 2023-07-07 18:53:51.879120988 +0900
@@ -156,7 +156,8 @@
                    if (strncmp(ne[j], prefix, strlen(prefix)) == 0 &&
                            ne[j][strlen(prefix)] == '_' &&
                            strncmp(ne[j] + strlen(prefix) + 1,
- config[i], e1) == 0)
+ config[i], e1) == 0 &&
+ ne[j][e1+strlen(prefix)+1] == '=')
   {
                          p = make_var(prefix, config[i]);
    if (p == NULL) {

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.