Project

General

Profile

Bug #12947 » dhcp6c-renew-12947.diff

Jim Pingle, 03/16/2022 02:36 PM

View differences:

src/etc/inc/interfaces.inc
5013 5013
		if ($debugOption == '-D') {
5014 5014
			$dhcp6cscriptwithoutra .= "/usr/bin/logger -t dhcp6c \"dhcp6c EXIT or RELEASE on {$wanif} running rc.newwanipv6\"\n";
5015 5015
		}
5016
		$dhcp6cscriptwithoutra .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}\"\n";
5016
		$dhcp6cscriptwithoutra .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}&reason=\${REASON}\"\n";
5017 5017
		$dhcp6cscriptwithoutra .= ";;\n";
5018
		$dhcp6cscriptwithoutra .= "RENEW|INFO)\n";
5018
		$dhcp6cscriptwithoutra .= "RENEW)\n";
5019 5019
		if ($debugOption == '-D') {
5020
			$dhcp6cscriptwithoutra .= "/usr/bin/logger -t dhcp6c \"dhcp6c renew, no change - bypassing update on {$wanif}\"\n";
5020
			$dhcp6cscriptwithoutra .= "/usr/bin/logger -t dhcp6c \"dhcp6c renew on {$wanif}\"\n";
5021
		}
5022
		$dhcp6cscriptwithoutra .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}&reason=\${REASON}\"\n";
5023
		$dhcp6cscriptwithoutra .= ";;\n";
5024
		$dhcp6cscriptwithoutra .= "INFO)\n";
5025
		if ($debugOption == '-D') {
5026
			$dhcp6cscriptwithoutra .= "/usr/bin/logger -t dhcp6c \"dhcp6c info request on {$wanif}, no changes\"\n";
5021 5027
		}
5022 5028
		$dhcp6cscriptwithoutra .= "esac\n";
5023 5029
		if (!@file_put_contents(
......
5056 5062
			if ($debugOption == '-D') {
5057 5063
				$dhcp6cscript .= "/usr/bin/logger -t dhcp6c \"dhcp6c RELEASE, REQUEST or EXIT on {$wanif} running rc.newwanipv6\"\n";
5058 5064
			}
5059
			$dhcp6cscript .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}\"\n";
5065
			$dhcp6cscript .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}&reason=\${REASON}\"\n";
5066
			$dhcp6cscript .= ";;\n";
5067
			$dhcp6cscript .= "RENEW)\n";
5068
			if ($debugOption == '-D') {
5069
				$dhcp6cscript .= "/usr/bin/logger -t dhcp6c \"dhcp6c renew on {$wanif}\"\n";
5070
			}
5071
			$dhcp6cscript .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\${dmnames}&dmips=\${dmips}&reason=\${REASON}\"\n";
5060 5072
			$dhcp6cscript .= ";;\n";
5061
			$dhcp6cscript .= "RENEW|INFO)\n";
5073
			$dhcp6cscript .= "INFO)\n";
5062 5074
			if ($debugOption == '-D') {
5063
				$dhcp6cscript .= "/usr/bin/logger -t dhcp6c \"dhcp6c renew, no change - bypassing update on {$wanif}\"\n";
5075
				$dhcp6cscript .= "/usr/bin/logger -t dhcp6c \"dhcp6c info request on {$wanif}, no changes\"\n";
5064 5076
			}
5065 5077
			$dhcp6cscript .= "esac\n";
5066 5078
			$rtsold_ra_ifs[] = $wanif;
src/etc/rc.newwanipv6
83 83
	return;
84 84
}
85 85

  
86
if (isset($_GET['reason'])) {
87
	$reason = $_GET['reason'];
88
} else {
89
	$reason = getenv("REASON");
90
}
91

  
92
if ((strtolower($reason) == "renew") &&
93
    file_exists("{$g['vardb_path']}/{$interface}_ipv6")) {
94
	/* Compare current WAN IPv6 to file */
95
	$old_ipv6 = chop(file_get_contents("/var/db/${interface}_ipv6"));
96
	if (is_ipaddrv6($old_ipv6) && ($old_ipv6 != $curwanipv6)) {
97
		log_error("rc.newwanipv6: IPv6 address changed for interface {$interface_descr} [{$interface}] (Old: {$old_ipv6}, New: {$curwanipv6}).");
98
	} else {
99
		log_error("rc.newwanipv6: No change in IPv6 address for interface {$interface_descr} [{$interface}]: {$curwanipv6}.");
100
		return;
101
	}
102
}
103

  
86 104
if (isset($_GET['dmips'])) {
87 105
	$new_domain_name_servers = $_GET['dmips'];
88 106
} else {
(1-1/3)