Project

General

Profile

« Previous | Next » 

Revision 46a7c9aa

Added by Seth Mos almost 14 years ago

Do not send reconfigure events in the rc.newwanipv6 until we figure out a way to not step on the v4 configure too.
Correct some variable names

View differences:

etc/rc.newwanipv6
57 57
*/
58 58

  
59 59
function restart_packages() {
60
	global $oldip, $curwanipi, $g;
60
	global $oldip, $curwanipv6, $g;
61 61

  
62 62
	/* restart packages */
63 63
	system_ntp_configure();
......
67 67

  
68 68
log_error("rc.newwanipv6: Informational is starting.");
69 69

  
70
$curwanip = get_interface_ipv6();
70
$curwanipv6 = get_interface_ipv6();
71 71
$interface = "wan";
72 72
$interface_real = get_real_interface();
73 73

  
74
if(is_ipaddr(trim($_ENV['new_domain_name_servers']))) {
75
	echo "DNS {$_ENV['new_domain_name_servers']}\n";
74
if(is_ipaddrv6(trim($_ENV['new_domain_name_servers']))) {
76 75
	file_put_contents("{$g['varetc_path']}/nameserver_v6{$interface}", trim($_ENV['new_domain_name_servers']));
77 76
}
78 77
if(!empty($_ENV['new_domain_name'])) {
......
82 81
log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real}).");
83 82

  
84 83
if($curwanipv6 == "" || !is_ipaddrv6($curwanipv6)) {
85
        log_error("rc.newwanipv6: Failed to update {$interface} IP, restarting...");
86
	send_event("interface reconfigure {$interface}");
84
        log_error("rc.newwanipv6: Failed to update {$interface} IPv6, restarting...");
85
	// send_event("interface reconfigure {$interface}");
87 86
        exit;
88 87
}
89 88

  
90 89
if (empty($interface)) {
91 90
	filter_configure();
92
	restart_packages();
91
	// restart_packages();
93 92
	exit;
94 93
}
95 94

  
96
$oldip = "";
95
$oldipv6 = "";
97 96
if (file_exists("{$g['vardb_path']}/{$interface}_cacheipv6"))
98 97
	$oldipv6 = file_get_contents("{$g['vardb_path']}/{$interface}_cacheipv6");
99 98

  
......
104 103
/* regenerate resolv.conf if DNS overrides are allowed */
105 104
system_resolvconf_generate(true);
106 105

  
107
/* write current WAN IP to file */
106
/* write current WAN IPv6 to file */
108 107
file_put_contents("{$g['vardb_path']}/{$interface}_ipv6", $curwanipv6);
109 108

  
110 109
/* reconfigure static routes (kernel may have deleted them) */
......
118 117

  
119 118
if (is_ipaddr($oldipv6) && $curwanipv6 == $oldipv6) {
120 119
	// Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing.
121
	if (in_array($config['interfaces'][$interface]['ipaddr'], array('pppoe', 'pptp', 'ppp'))) {
120
	if (in_array($config['interfaces'][$interface]['ipaddrv6'], array('pppoe', 'pptp', 'ppp'))) {
122 121
		/* reconfigure IPsec tunnels */
123 122
		vpn_ipsec_force_reload();
124 123

  

Also available in: Unified diff