Ticket #2167: dhcp-3.0.5-client_dns-1.patch

File dhcp-3.0.5-client_dns-1.patch, 1.4 KB (added by dnicholson@…, 17 years ago)

Patch from upstream 3.1.0a1 to fix the DNS servers issue

  • client/scripts/linux

    Patch from upstream that fixes issues with always regenerating
    /etc/resolv.conf whether the DNS server has changed or not.
    
    diff -pNur dhcp-3.0.5.orig/client/scripts/linux dhcp-3.0.5/client/scripts/linux
    old new  
    2323# of the $1 in its args.
    2424
    2525make_resolv_conf() {
    26   if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
    27     echo search $new_domain_name >/etc/resolv.conf
    28     chmod 644 /etc/resolv.conf
     26  if [ x"$new_domain_name_servers" != x ]; then
     27    cat /dev/null > /etc/resolv.conf.dhclient
     28    chmod 644 /etc/resolv.conf.dhclient
     29    if [ x"$new_domain_search" != x ]; then
     30      echo search $new_domain_search >> /etc/resolv.conf.dhclient
     31    elif [ x"$new_domain_name" != x ]; then
     32      # Note that the DHCP 'Domain Name Option' is really just a domain
     33      # name, and that this practice of using the domain name option as
     34      # a search path is both nonstandard and deprecated.
     35      echo search $new_domain_name >> /etc/resolv.conf.dhclient
     36    fi
    2937    for nameserver in $new_domain_name_servers; do
    30       echo nameserver $nameserver >>/etc/resolv.conf
     38      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
    3139    done
     40
     41    mv /etc/resolv.conf.dhclient /etc/resolv.conf
    3242  fi
    3343}
    3444