From: Stefan Schantl Date: Sat, 5 Sep 2015 19:45:30 +0000 (+0200) Subject: Merge branch 'master' of git://git.ipfire.org/network X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fnetwork.git;a=commitdiff_plain;h=906475ee6b04c44c4704291699c0dc9ecda2bfd1;hp=8efbf77e4c76b226d4b39a4081db53b4e46ea8a1 Merge branch 'master' of git://git.ipfire.org/network --- diff --git a/src/dhclient-script b/src/dhclient-script index fd5c6f13..9d18dba2 100644 --- a/src/dhclient-script +++ b/src/dhclient-script @@ -91,7 +91,7 @@ case "${reason}" in # Update nameservers if those have changed if [[ "${old_dhcp6_name_servers}" != "${new_dhcp6_name_servers}" ]]; then db_set "${interface}/ipv6/domain-name-servers" "${new_dhcp6_name_servers}" - dns_generate_resolvconf + dns_server_update fi # Update the lifetime if the address has not changed @@ -247,8 +247,8 @@ case "${reason}" in routing_update ${interface} ipv4 routing_default_update - # Update resolv.conf - dns_generate_resolvconf + # Update DNS configuration + dns_server_update fi ;; esac diff --git a/src/functions/functions.dns b/src/functions/functions.dns index 50354689..a54feecd 100644 --- a/src/functions/functions.dns +++ b/src/functions/functions.dns @@ -225,6 +225,16 @@ dns_server_parse_line() { return ${EXIT_OK} } +# This function should be called after any configuration +# changes have been made to the DNS servers. +dns_server_update() { + # Regenerate /etc/resolv.conf + dns_generate_resolvconf + + # Restart radvd which propagates IPv6 DNS servers + radvd_update +} + # Update resolv.conf(5) when initializing the network. init_register dns_generate_resolvconf diff --git a/src/functions/functions.routing b/src/functions/functions.routing index 66346107..707e0268 100644 --- a/src/functions/functions.routing +++ b/src/functions/functions.routing @@ -130,7 +130,7 @@ routing_db_from_ppp() { # Save the MAC address of the remote DSLAM if isset PPP_MACREMOTE; then - db_set "${zone}/${proto}/remote-address" "${PPP_MACREMOTE,,}" + db_set "${zone}/remote-address" "${PPP_MACREMOTE,,}" fi } diff --git a/src/hooks/zones/pppoe b/src/hooks/zones/pppoe index 790822a8..865bbc59 100644 --- a/src/hooks/zones/pppoe +++ b/src/hooks/zones/pppoe @@ -232,6 +232,9 @@ hook_status() { # XXX display time since connection started cli_headline 2 "Point-to-Point-over-Ethernet protocol" + cli_print_fmt1 2 "MAC-Remote" "$(db_get "${zone}/remote-address")" + cli_space + local proto for proto in ${IP_SUPPORTED_PROTOCOLS}; do db_exists "${zone}/${proto}" || continue @@ -252,9 +255,7 @@ hook_status() { cli_print_fmt1 3 "IP address" "$(db_get "${zone}/${proto}/local-ip-address")" cli_print_fmt1 3 "Gateway" "$(db_get "${zone}/${proto}/remote-ip-address")" - cli_print_fmt1 3 "DNS servers" "$(db_get "${zone}/${proto}/dns")" - cli_space - cli_print_fmt1 3 "MAC-Remote" "$(db_get "${zone}/${proto}/remote-address")" + cli_print_fmt1 3 "DNS servers" "$(db_get "${zone}/${proto}/domain-name-servers")" cli_space done diff --git a/src/network b/src/network index 12e9742f..4d23e504 100644 --- a/src/network +++ b/src/network @@ -1245,8 +1245,7 @@ cli_dns_server() { esac # Update the local DNS configuration after changes have been made. - dns_generate_resolvconf - radvd_update + dns_server_update exit ${EXIT_OK} }