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
ac8eba7d
Commit
ac8eba7d
authored
Sep 13, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another test
parent
bc2765ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
29 deletions
+18
-29
interfaces.inc
src/etc/inc/interfaces.inc
+0
-16
rc.carpbackup
src/etc/rc.carpbackup
+0
-6
rc.carpmaster
src/etc/rc.carpmaster
+0
-6
rc.linkup
src/etc/rc.linkup
+18
-1
No files found.
src/etc/inc/interfaces.inc
View file @
ac8eba7d
...
...
@@ -1158,18 +1158,6 @@ function interface_reconfigure($interface = 'wan', $reloadall = false)
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
)
{
$vipif
=
get_real_interface
(
$vip
[
'interface'
]);
...
...
@@ -1946,10 +1934,6 @@ function interfaces_vips_configure($interface = '')
if
(
$interface
<>
""
&&
$vip
[
'interface'
]
<>
$interface
)
{
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
)
{
$carp_setuped
=
true
;
}
...
...
src/etc/rc.carpbackup
View file @
ac8eba7d
...
...
@@ -58,9 +58,3 @@ if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'
}
}
$pluginparams
=
array
();
$pluginparams
[
'type'
]
=
'carp'
;
$pluginparams
[
'event'
]
=
'rc.carpbackup'
;
$pluginparams
[
'interface'
]
=
$argv
[
1
];
?>
src/etc/rc.carpmaster
View file @
ac8eba7d
...
...
@@ -66,9 +66,3 @@ if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'
}
}
$pluginparams
=
array
();
$pluginparams
[
'type'
]
=
'carp'
;
$pluginparams
[
'event'
]
=
'rc.carpmaster'
;
$pluginparams
[
'interface'
]
=
$argv
[
1
];
?>
src/etc/rc.linkup
View file @
ac8eba7d
...
...
@@ -38,6 +38,23 @@ require_once("system.inc");
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
/**
* signal CARP to go down when there's a ip configured on the provided interface
* interfaces_carp_setup will enable carp when pfsync completes.
*/
function
interface_signal_carp
(
$intf
)
{
global
$config
;
if
(
!
empty
(
$config
[
'virtualip'
][
'vip'
]))
{
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vip
)
{
if
(
$vip
[
'interface'
]
==
$intf
&&
$vip
[
'mode'
]
==
'carp'
)
{
set_single_sysctl
(
"net.inet.carp.allow"
,
"0"
);
}
}
}
}
function
handle_argument_group
(
$iface
,
$argument2
)
{
global
$config
;
...
...
@@ -68,7 +85,7 @@ function handle_argument_group($iface, $argument2) {
case
"stop"
:
log_error
(
"DEVD Ethernet detached event for
{
$iface
}
"
);
interface_bring_down
(
$iface
);
interface_
vips_bring_down
(
$iface
);
interface_
signal_carp
(
$iface
);
break
;
case
"start"
:
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