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
a99ed3ee
Commit
a99ed3ee
authored
May 11, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: $configip for unified reload code later...
parent
f305ecaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
rc.newwanip
src/etc/rc.newwanip
+5
-3
rc.newwanipv6
src/etc/rc.newwanipv6
+3
-1
No files found.
src/etc/rc.newwanip
View file @
a99ed3ee
...
@@ -79,13 +79,15 @@ if ((empty($ip) || !is_ipaddr($ip)) && substr($interface_real, 0, 4) != 'ovpn')
...
@@ -79,13 +79,15 @@ if ((empty($ip) || !is_ipaddr($ip)) && substr($interface_real, 0, 4) != 'ovpn')
return
;
return
;
}
}
$configip
=
$config
[
'interfaces'
][
$interface
][
'ipaddr'
];
$cacheip_file
=
"/var/db/
{
$interface
}
_cacheip"
;
$cacheip_file
=
"/var/db/
{
$interface
}
_cacheip"
;
$ipfile
=
"/var/db/
{
$interface
}
_ip"
;
$ip
_
file
=
"/var/db/
{
$interface
}
_ip"
;
/* write the current interface IP to file */
/* write the current interface IP to file */
/* used in src/sbin/dhclient-script.ext */
/* used in src/sbin/dhclient-script.ext */
if
(
is_ipaddr
(
$ip
))
{
if
(
is_ipaddr
(
$ip
))
{
@
file_put_contents
(
$ipfile
,
$ip
);
@
file_put_contents
(
$ip
_
file
,
$ip
);
}
}
link_interface_to_vips
(
$interface
,
"update"
);
link_interface_to_vips
(
$interface
,
"update"
);
...
@@ -155,7 +157,7 @@ $cacheip = @file_get_contents($cacheip_file);
...
@@ -155,7 +157,7 @@ $cacheip = @file_get_contents($cacheip_file);
* Even with the same IP the VPN software is unhappy with the IP disappearing, and we
* 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.
* could be failing back in which case we need to switch IPs back anyhow.
*/
*/
if
(
!
is_ipaddr
(
$cacheip
)
||
$ip
!=
$cacheip
||
!
is_ipaddr
(
$config
[
'interfaces'
][
$interface
][
'ipaddr'
]
))
{
if
(
!
is_ipaddr
(
$cacheip
)
||
$ip
!=
$cacheip
||
!
is_ipaddr
(
$config
ip
))
{
@
unlink
(
$cacheip_file
);
@
unlink
(
$cacheip_file
);
system_routing_configure
(
$interface
);
system_routing_configure
(
$interface
);
...
...
src/etc/rc.newwanipv6
View file @
a99ed3ee
...
@@ -76,6 +76,8 @@ if ((empty($ip) || !is_ipaddr($ip)) && substr($interface_real, 0, 4) != 'ovpn')
...
@@ -76,6 +76,8 @@ if ((empty($ip) || !is_ipaddr($ip)) && substr($interface_real, 0, 4) != 'ovpn')
return
;
return
;
}
}
$configip
=
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
];
$searchdomain_file
=
"/var/etc/searchdomain_v6
{
$interface
}
"
;
$searchdomain_file
=
"/var/etc/searchdomain_v6
{
$interface
}
"
;
$nameserver_file
=
"/var/etc/nameserver_v6
{
$interface
}
"
;
$nameserver_file
=
"/var/etc/nameserver_v6
{
$interface
}
"
;
$cacheip_file
=
"/var/db/
{
$interface
}
_cacheipv6"
;
$cacheip_file
=
"/var/db/
{
$interface
}
_cacheipv6"
;
...
@@ -123,7 +125,7 @@ $cacheip = @file_get_contents($cacheip_file);
...
@@ -123,7 +125,7 @@ $cacheip = @file_get_contents($cacheip_file);
* Even with the same IP the VPN software is unhappy with the IP disappearing, and we
* 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.
* could be failing back in which case we need to switch IPs back anyhow.
*/
*/
if
(
!
is_ipaddr
(
$cacheip
)
||
$ip
!=
$cacheip
||
!
is_ipaddr
(
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
]
))
{
if
(
!
is_ipaddr
(
$cacheip
)
||
$ip
!=
$cacheip
||
!
is_ipaddr
(
$config
ip
))
{
if
(
is_ipaddr
(
$ip
))
{
if
(
is_ipaddr
(
$ip
))
{
if
(
$ip
==
$cacheip
)
{
if
(
$ip
==
$cacheip
)
{
if
(
in_array
(
$config
[
'interfaces'
][
$interface
][
'ipaddr'
],
array
(
'l2tp'
,
'ppp'
,
'pppoe'
,
'pptp'
)))
{
if
(
in_array
(
$config
[
'interfaces'
][
$interface
][
'ipaddr'
],
array
(
'l2tp'
,
'ppp'
,
'pppoe'
,
'pptp'
)))
{
...
...
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