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
8ebc1223
Commit
8ebc1223
authored
Feb 16, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: small steps towards better PPPoE IPv6 handling #1403
parent
b3ed2232
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
interfaces.inc
src/etc/inc/interfaces.inc
+3
-0
rc.newwanipv6
src/etc/rc.newwanipv6
+17
-10
No files found.
src/etc/inc/interfaces.inc
View file @
8ebc1223
...
@@ -1238,8 +1238,11 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
...
@@ -1238,8 +1238,11 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
@
unlink
(
"/var/db/
{
$interface
}
ip"
);
@
unlink
(
"/var/db/
{
$interface
}
ip"
);
@
unlink
(
"/var/db/
{
$interface
}
ipv6"
);
@
unlink
(
"/var/db/
{
$interface
}
ipv6"
);
@
unlink
(
"/var/etc/nameserver_
{
$realif
}
"
);
@
unlink
(
"/var/etc/nameserver_
{
$realif
}
"
);
@
unlink
(
"/var/etc/nameserver_v6
{
$realif
}
"
);
@
unlink
(
"/var/etc/searchdomain_
{
$realif
}
"
);
@
unlink
(
"/var/etc/searchdomain_
{
$realif
}
"
);
@
unlink
(
"/var/etc/searchdomain_v6
{
$realif
}
"
);
@
unlink
(
"/tmp/
{
$realif
}
up"
);
@
unlink
(
"/tmp/
{
$realif
}
up"
);
@
unlink
(
"/tmp/
{
$realif
}
upv6"
);
@
unlink
(
"/tmp/
{
$realif
}
_router"
);
@
unlink
(
"/tmp/
{
$realif
}
_router"
);
@
unlink
(
"/tmp/
{
$realif
}
_routerv6"
);
@
unlink
(
"/tmp/
{
$realif
}
_routerv6"
);
...
...
src/etc/rc.newwanipv6
View file @
8ebc1223
...
@@ -63,16 +63,16 @@ if (empty($interface)) {
...
@@ -63,16 +63,16 @@ if (empty($interface)) {
}
}
//Do not process while booting
//Do not process while booting
if
(
file_exists
(
"/var/run/booting"
)
&&
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
]
!=
"dhcp6"
)
if
(
file_exists
(
"/var/run/booting"
)
&&
$config
[
'interfaces'
][
$interface
][
'ipaddrv6'
]
!=
"dhcp6"
)
{
return
;
return
;
}
/*
/*
* NOTE: Take care of openvpn and similar if you generate the event to reconfigure an interface.
* NOTE: Take care of openvpn and similar if you generate the event to reconfigure an interface.
* i.e. OpenVPN might be in tap mode and not have an ip.
* i.e. OpenVPN might be in tap mode and not have an ip.
*/
*/
if
((
empty
(
$curwanipv6
)
||
!
is_ipaddrv6
(
$curwanipv6
))
&&
substr
(
$interface_real
,
0
,
4
)
!=
"ovpn"
)
{
if
((
empty
(
$curwanipv6
)
||
!
is_ipaddrv6
(
$curwanipv6
))
&&
substr
(
$interface_real
,
0
,
4
)
!=
"ovpn"
)
{
log_error
(
"rc.newwanipv6: Failed to update
{
$interface_descr
}
[
{
$interface
}
] IPv6, restarting..."
);
log_error
(
"rc.newwanipv6: Failed to detect IPv6 for
{
$interface_descr
}
[
{
$interface
}
]"
);
// configd_run("interface reconfigure {$interface}");
return
;
return
;
}
}
...
@@ -85,26 +85,31 @@ if (!empty($new_domain_name_servers)) {
...
@@ -85,26 +85,31 @@ if (!empty($new_domain_name_servers)) {
$valid_ns
[]
=
trim
(
$ns
);
$valid_ns
[]
=
trim
(
$ns
);
}
}
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 */
if
(
is_ipaddrv6
(
$curwanipv6
))
if
(
is_ipaddrv6
(
$curwanipv6
))
{
@
file_put_contents
(
"/var/db/
{
$interface
}
_ipv6"
,
$curwanipv6
);
@
file_put_contents
(
"/var/db/
{
$interface
}
_ipv6"
,
$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
=
""
;
if
(
file_exists
(
"/var/db/
{
$interface
}
_cacheipv6"
))
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
);
$grouptmp
=
link_interface_to_group
(
$interface
);
if
(
!
empty
(
$grouptmp
))
if
(
!
empty
(
$grouptmp
))
{
array_walk
(
$grouptmp
,
'interface_group_add_member'
);
array_walk
(
$grouptmp
,
'interface_group_add_member'
);
}
link_interface_to_track6
(
$interface
,
"update"
);
link_interface_to_track6
(
$interface
,
"update"
);
system_resolvconf_generate
();
system_resolvconf_generate
();
...
@@ -124,12 +129,14 @@ if (is_ipaddrv6($oldipv6)) {
...
@@ -124,12 +129,14 @@ if (is_ipaddrv6($oldipv6)) {
}
}
/* start OpenVPN server & clients */
/* start OpenVPN server & clients */
if
(
substr
(
$interface_real
,
0
,
4
)
!=
"ovpn"
)
if
(
substr
(
$interface_real
,
0
,
4
)
!=
"ovpn"
)
{
openvpn_resync_all
(
$interface
);
openvpn_resync_all
(
$interface
);
}
}
}
return
;
return
;
}
else
if
(
does_interface_exist
(
$interface_real
))
}
else
if
(
does_interface_exist
(
$interface_real
))
{
mwexec
(
"/sbin/ifconfig
{
$interface_real
}
inet6
{
$oldipv6
}
delete"
);
mwexec
(
"/sbin/ifconfig
{
$interface_real
}
inet6
{
$oldipv6
}
delete"
);
}
file_put_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
,
$curwanipv6
);
file_put_contents
(
"/var/db/
{
$interface
}
_cacheipv6"
,
$curwanipv6
);
}
}
...
...
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