Revision 9e6b1893
Added by Marcos M over 1 year ago
src/etc/rc.newwanip | ||
---|---|---|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
$oldip = "0.0.0.0"; |
111 |
if (file_exists("{$g['vardb_path']}/{$interface}_cacheip")) {
|
|
112 |
$oldip = file_get_contents("{$g['vardb_path']}/{$interface}_cacheip");
|
|
111 |
if (file_exists(g_get('vardb_path') . "/{$interface_real}_cacheip")) {
|
|
112 |
$oldip = file_get_contents(g_get('vardb_path') . "/{$interface_real}_cacheip");
|
|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
/* regenerate resolv.conf */ |
... | ... | |
117 | 117 |
|
118 | 118 |
/* write the current interface IP to file */ |
119 | 119 |
if (is_ipaddr($curwanip)) { |
120 |
@file_put_contents("{$g['vardb_path']}/{$interface}_ip", $curwanip);
|
|
120 |
@file_put_contents(g_get('vardb_path') . "/{$interface_real}_ip", $curwanip);
|
|
121 | 121 |
} |
122 | 122 |
|
123 | 123 |
link_interface_to_vips($interface, "update"); |
... | ... | |
244 | 244 |
services_unbound_configure(true, $interface); |
245 | 245 |
|
246 | 246 |
if (is_ipaddr($curwanip)) { |
247 |
@file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
|
|
247 |
@file_put_contents(g_get('vardb_path') . "/{$interface_real}_cacheip", $curwanip);
|
|
248 | 248 |
} |
249 | 249 |
|
250 | 250 |
/* perform RFC 2136 DNS update */ |
src/etc/rc.newwanipv6 | ||
---|---|---|
114 | 114 |
|
115 | 115 |
/* write current WAN IPv6 to file */ |
116 | 116 |
if (is_ipaddrv6($curwanipv6)) { |
117 |
@file_put_contents("{$g['vardb_path']}/{$interface}_ipv6", $curwanipv6);
|
|
117 |
@file_put_contents(g_get('vardb_path') . "/{$interface_real}_ipv6", $curwanipv6);
|
|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real})."); |
121 | 121 |
|
122 | 122 |
$oldipv6 = ''; |
123 |
if (file_exists("{$g['vardb_path']}/{$interface}_cacheipv6")) {
|
|
124 |
$oldipv6 = file_get_contents("{$g['vardb_path']}/{$interface}_cacheipv6");
|
|
123 |
if (file_exists(g_get('vardb_path') . "/{$interface_real}_cacheipv6")) {
|
|
124 |
$oldipv6 = file_get_contents(g_get('vardb_path') . "/{$interface_real}_cacheipv6");
|
|
125 | 125 |
} |
126 | 126 |
|
127 | 127 |
$grouptmp = link_interface_to_group($interface); |
... | ... | |
163 | 163 |
mwexec("/sbin/ifconfig {$interface_real} inet6 {$oldipv6} delete"); |
164 | 164 |
} |
165 | 165 |
|
166 |
file_put_contents("{$g['vardb_path']}/{$interface}_cacheipv6", $curwanipv6);
|
|
166 |
file_put_contents(g_get('vardb_path') . "/{$interface_real}_cacheipv6", $curwanipv6);
|
|
167 | 167 |
} |
168 | 168 |
|
169 | 169 |
if ($srvupdate) { |
Also available in: Unified diff
Use the real interface name when storing the interface address.
The updated filename aligns with the references in:
find_interface_ip(), delete_old_address(), and add_new_address().