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
bc2765ea
Commit
bc2765ea
authored
Sep 12, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring vips down when interface is down, fix carp setup order.
parent
b90babbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
interfaces.inc
src/etc/inc/interfaces.inc
+27
-1
rc.linkup
src/etc/rc.linkup
+1
-0
No files found.
src/etc/inc/interfaces.inc
View file @
bc2765ea
...
@@ -1158,6 +1158,18 @@ function interface_reconfigure($interface = 'wan', $reloadall = false)
...
@@ -1158,6 +1158,18 @@ function interface_reconfigure($interface = 'wan', $reloadall = false)
interface_configure
(
$interface
,
$reloadall
);
interface_configure
(
$interface
,
$reloadall
);
}
}
function
interface_vips_bring_down
(
$intf
)
{
global
$config
;
if
(
!
empty
(
$config
[
'virtualip'
][
'vip'
]))
{
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vip
)
{
if
(
$vip
[
'interface'
]
==
$intf
)
{
interface_vip_bring_down
(
$vip
);
}
}
}
}
function
interface_vip_bring_down
(
$vip
)
function
interface_vip_bring_down
(
$vip
)
{
{
$vipif
=
get_real_interface
(
$vip
[
'interface'
]);
$vipif
=
get_real_interface
(
$vip
[
'interface'
]);
...
@@ -1825,7 +1837,17 @@ function interfaces_carp_setup()
...
@@ -1825,7 +1837,17 @@ function interfaces_carp_setup()
mwexec
(
"/sbin/ifconfig pfsync0 -syncdev -syncpeer down"
,
false
);
mwexec
(
"/sbin/ifconfig pfsync0 -syncdev -syncpeer down"
,
false
);
}
}
if
(
isset
(
$config
[
'virtualip'
][
'vip'
])
&&
$config
[
'virtualip'
][
'vip'
])
{
$has_carp_vips
=
false
;
if
(
isset
(
$config
[
'virtualip'
][
'vip'
])
&&
count
(
$config
[
'virtualip'
][
'vip'
])
>
0
)
{
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vip
)
{
if
(
$vip
[
'mode'
]
==
'carp'
)
{
$has_carp_vips
=
true
;
break
;
}
}
}
if
(
$has_carp_vips
)
{
set_single_sysctl
(
"net.inet.carp.allow"
,
"1"
);
set_single_sysctl
(
"net.inet.carp.allow"
,
"1"
);
}
else
{
}
else
{
set_single_sysctl
(
"net.inet.carp.allow"
,
"0"
);
set_single_sysctl
(
"net.inet.carp.allow"
,
"0"
);
...
@@ -1924,6 +1946,10 @@ function interfaces_vips_configure($interface = '')
...
@@ -1924,6 +1946,10 @@ function interfaces_vips_configure($interface = '')
if
(
$interface
<>
""
&&
$vip
[
'interface'
]
<>
$interface
)
{
if
(
$interface
<>
""
&&
$vip
[
'interface'
]
<>
$interface
)
{
continue
;
continue
;
}
}
if
(
!
$carp_setuped
)
{
// interfaces_carp_setup will enable carp when pfsync completes.
set_single_sysctl
(
"net.inet.carp.allow"
,
"0"
);
}
if
(
$carp_setuped
==
false
)
{
if
(
$carp_setuped
==
false
)
{
$carp_setuped
=
true
;
$carp_setuped
=
true
;
}
}
...
...
src/etc/rc.linkup
View file @
bc2765ea
...
@@ -68,6 +68,7 @@ function handle_argument_group($iface, $argument2) {
...
@@ -68,6 +68,7 @@ function handle_argument_group($iface, $argument2) {
case
"stop"
:
case
"stop"
:
log_error
(
"DEVD Ethernet detached event for
{
$iface
}
"
);
log_error
(
"DEVD Ethernet detached event for
{
$iface
}
"
);
interface_bring_down
(
$iface
);
interface_bring_down
(
$iface
);
interface_vips_bring_down
(
$iface
);
break
;
break
;
case
"start"
:
case
"start"
:
log_error
(
"DEVD Ethernet attached event for
{
$iface
}
"
);
log_error
(
"DEVD Ethernet attached event for
{
$iface
}
"
);
...
...
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