Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f729d881
Commit
f729d881
authored
Apr 06, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: align the behaviour of IPv4 and IPv6 IP renewal
PR:
https://github.com/opnsense/core/pull/1524
parent
955e1fca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
33 deletions
+28
-33
rc.newwanip
src/etc/rc.newwanip
+1
-5
rc.newwanipv6
src/etc/rc.newwanipv6
+27
-28
No files found.
src/etc/rc.newwanip
View file @
f729d881
...
...
@@ -94,11 +94,7 @@ if ($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) {
}
}
if
(
file_exists
(
"/var/db/
{
$interface
}
_cacheip"
))
{
$oldip
=
file_get_contents
(
"/var/db/
{
$interface
}
_cacheip"
);
}
else
{
$oldip
=
"0.0.0.0"
;
}
$oldip
=
@
file_get_contents
(
"/var/db/
{
$interface
}
_cacheip"
);
system_resolvconf_generate
();
...
...
src/etc/rc.newwanipv6
View file @
f729d881
...
...
@@ -83,12 +83,12 @@ if (!empty($new_domain_name_servers)) {
}
if
(
count
(
$valid_ns
)
>
0
)
{
file_put_contents
(
"/var/etc/nameserver_v6
{
$interface
}
"
,
implode
(
"
\n
"
,
$valid_ns
));
@
file_put_contents
(
"/var/etc/nameserver_v6
{
$interface
}
"
,
implode
(
"
\n
"
,
$valid_ns
));
}
}
$new_domain_name
=
getenv
(
"new_domain_name"
);
if
(
!
empty
(
$new_domain_name
))
{
file_put_contents
(
"/var/etc/searchdomain_v6
{
$interface
}
"
,
$new_domain_name
);
@
file_put_contents
(
"/var/etc/searchdomain_v6
{
$interface
}
"
,
$new_domain_name
);
}
/* write current WAN IPv6 to file */
...
...
@@ -98,10 +98,7 @@ if (is_ipaddrv6($curwanipv6)) {
log_error
(
"rc.newwanipv6: on (IP address:
{
$curwanipv6
}
) (interface:
{
$interface
}
) (real interface:
{
$interface_real
}
)."
);
$oldipv6
=
""
;
if
(
file_exists
(
"/var/db/
{
$interface
}
_cacheipv6"
))
{
$oldipv6
=
file_get_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
);
}
$oldipv6
=
@
file_get_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
);
$grouptmp
=
link_interface_to_group
(
$interface
);
if
(
!
empty
(
$grouptmp
))
{
...
...
@@ -110,30 +107,32 @@ if (!empty($grouptmp)) {
link_interface_to_track6
(
$interface
,
"update"
);
system_resolvconf_generate
();
system_routing_configure
(
$interface
);
setup_gateways_monitor
();
/* signal filter reload */
filter_configure
();
if
(
is_ipaddrv6
(
$oldipv6
))
{
if
(
$curwanipv6
==
$oldipv6
)
{
// Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing.
if
(
in_array
(
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
],
array
(
'pppoe'
,
'pptp'
,
'ppp'
)))
{
/* XXX migrate this: we should unify the reload */
ipsec_configure_do
(
false
,
$inteface
);
openvpn_configure_do
(
false
,
$interface
);
}
return
;
}
elseif
(
does_interface_exist
(
$interface_real
))
{
/*
* We need to force sync VPNs on such even when the IP is the same for dynamic interfaces.
* Even with the same IP the VPN software is unhappy with the IP disappearing, and we
* could be failing back in which case we need to switch IPs back anyhow.
*/
if
(
!
is_ipaddr
(
$oldipv6
)
||
$curwanipv6
!=
$oldipv6
||
!
is_ipaddrv6
(
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
]))
{
system_routing_configure
(
$interface
);
setup_gateways_monitor
();
if
(
is_ipaddrv6
(
$oldipv6
))
{
if
(
does_interface_exist
(
$interface_real
))
{
mwexec
(
"/sbin/ifconfig
{
$interface_real
}
inet6
{
$oldipv6
}
delete"
);
}
}
file_put_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
,
$curwanipv6
);
}
if
(
is_ipaddrv6
(
$curwanip
))
{
@
file_put_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
,
$curwanipv6
);
}
/* reload plugins */
plugins_configure
(
'interface'
,
false
,
array
(
$interface
));
/* reload plugins */
plugins_configure
(
'interface'
,
false
,
array
(
$interface
));
/* reload graphing functions */
rrd_configure
();
}
/* reload
graphing functions
*/
rrd_configure
();
/* reload
filter, don't try to sync to carp slave
*/
filter_configure_sync
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment