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
Hide 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)) {
...
@@ -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"
);
$oldip
=
file_get_contents
(
"/var/db/
{
$interface
}
_cacheip"
);
}
else
{
$oldip
=
"0.0.0.0"
;
}
system_resolvconf_generate
();
system_resolvconf_generate
();
...
...
src/etc/rc.newwanipv6
View file @
f729d881
...
@@ -83,12 +83,12 @@ if (!empty($new_domain_name_servers)) {
...
@@ -83,12 +83,12 @@ if (!empty($new_domain_name_servers)) {
}
}
if
(
count
(
$valid_ns
)
>
0
)
{
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"
);
$new_domain_name
=
getenv
(
"new_domain_name"
);
if
(
!
empty
(
$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 */
/* write current WAN IPv6 to file */
...
@@ -98,10 +98,7 @@ if (is_ipaddrv6($curwanipv6)) {
...
@@ -98,10 +98,7 @@ if (is_ipaddrv6($curwanipv6)) {
log_error
(
"rc.newwanipv6: on (IP address:
{
$curwanipv6
}
) (interface:
{
$interface
}
) (real interface:
{
$interface_real
}
)."
);
log_error
(
"rc.newwanipv6: on (IP address:
{
$curwanipv6
}
) (interface:
{
$interface
}
) (real interface:
{
$interface_real
}
)."
);
$oldipv6
=
""
;
$oldipv6
=
@
file_get_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
);
if
(
file_exists
(
"/var/db/
{
$interface
}
_cacheipv6"
))
{
$oldipv6
=
file_get_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
);
}
$grouptmp
=
link_interface_to_group
(
$interface
);
$grouptmp
=
link_interface_to_group
(
$interface
);
if
(
!
empty
(
$grouptmp
))
{
if
(
!
empty
(
$grouptmp
))
{
...
@@ -110,30 +107,32 @@ if (!empty($grouptmp)) {
...
@@ -110,30 +107,32 @@ if (!empty($grouptmp)) {
link_interface_to_track6
(
$interface
,
"update"
);
link_interface_to_track6
(
$interface
,
"update"
);
system_resolvconf_generate
();
system_resolvconf_generate
();
system_routing_configure
(
$interface
);
setup_gateways_monitor
();
/*
* We need to force sync VPNs on such even when the IP is the same for dynamic interfaces.
/* signal filter reload */
* Even with the same IP the VPN software is unhappy with the IP disappearing, and we
filter_configure
();
* could be failing back in which case we need to switch IPs back anyhow.
*/
if
(
is_ipaddrv6
(
$oldipv6
))
{
if
(
!
is_ipaddr
(
$oldipv6
)
||
$curwanipv6
!=
$oldipv6
||
!
is_ipaddrv6
(
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
]
))
{
if
(
$curwanipv6
==
$oldipv6
)
{
system_routing_configure
(
$interface
);
// Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing.
setup_gateways_monitor
();
if
(
in_array
(
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
],
array
(
'pppoe'
,
'pptp'
,
'ppp'
)))
{
/* XXX migrate this: we should unify the reload */
if
(
is_ipaddrv6
(
$oldipv6
))
{
ipsec_configure_do
(
false
,
$inteface
);
if
(
does_interface_exist
(
$interface_real
))
{
openvpn_configure_do
(
false
,
$interface
);
mwexec
(
"/sbin/ifconfig
{
$interface_real
}
inet6
{
$oldipv6
}
delete"
);
}
}
return
;
}
elseif
(
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 */
/* reload plugins */
plugins_configure
(
'interface'
,
false
,
array
(
$interface
));
plugins_configure
(
'interface'
,
false
,
array
(
$interface
));
/* reload graphing functions */
rrd_configure
();
}
/* reload
graphing functions
*/
/* reload
filter, don't try to sync to carp slave
*/
rrd_configure
();
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