Skip to content

Commit

Permalink
Attempt to ensure interface_dhcpv6_configure() is called at the most …
Browse files Browse the repository at this point in the history
…appropriate time

* ppp-ipv6 for PPP type with dhcp6usev4iface (or PPP without dhcp6usev4iface, as dhcp6usev4iface appears to be a no-op on this type of connection)
* rc.newwanip for non-PPP type with dhcp6usev4iface (no change in this commit)
* interface_configure() in all other cases
  • Loading branch information
davidjwood committed Jan 6, 2016
1 parent 5a64058 commit 20d6e88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions etc/inc/interfaces.inc
Expand Up @@ -3050,8 +3050,9 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
case 'slaac':
case 'dhcp6':
// N.B. PPP connections using PPP as the IPv6 parent interface are excluded because the ppp-ipv6 script
// calls interface_dhcpv6_configure() for these connections after IPv6CP is up
if (!(interface_isppp_type($interface) && isset($wancfg['dhcp6usev4iface']))) {
// calls interface_dhcpv6_configure() for these connections after IPv6CP is up, whilst rc.newwanip
// handles all non-PPP connections with 'dhcp6usev4iface' set
if (!(isset($wancfg['dhcp6usev4iface']) || $wancfg['ipaddr']==='ppp')) {
interface_dhcpv6_configure($interface, $wancfg);
}
break;
Expand Down
4 changes: 2 additions & 2 deletions usr/local/sbin/ppp-ipv6
Expand Up @@ -26,7 +26,7 @@ function interface_ipv6_lower($interface_real) {
case 'slaac':
case 'dhcp6':
// Take no action if dhcp6 is active on the parent interface, not the PPP interface
if ($ifcfg['ipaddrv6']==='dhcp6' && !isset($ifcfg['dhcp6usev4iface'])) {
if ($ifcfg['ipaddrv6']==='dhcp6' && !(isset($ifcfg['dhcp6usev4iface']) || $ifcfg['ipaddr']==='ppp')) {
break;
}
// bring down dhcp6c if it is running
Expand Down Expand Up @@ -70,7 +70,7 @@ function interface_ipv6_raise($interface_real) {
case 'slaac':
case 'dhcp6':
// Take no action if dhcp6 is active on the parent interface, not the PPP interface
if ($ifcfg['ipaddrv6']==='dhcp6' && !isset($ifcfg['dhcp6usev4iface'])) {
if ($ifcfg['ipaddrv6']==='dhcp6' && !(isset($ifcfg['dhcp6usev4iface']) || $ifcfg['ipaddr']==='ppp')) {
break;
}
$pidv6 = find_dhcp6c_process($interface_real);
Expand Down

0 comments on commit 20d6e88

Please sign in to comment.