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
e86885cb
Commit
e86885cb
authored
Aug 12, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: fix clearing the dhcp config file when override file is gone #1052
parent
3e0be395
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
36 deletions
+14
-36
interfaces.inc
src/etc/inc/interfaces.inc
+14
-36
No files found.
src/etc/inc/interfaces.inc
View file @
e86885cb
...
...
@@ -3411,7 +3411,13 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
// DHCP6 Config File Override
if
(
!
empty
(
$wancfg
[
'adv_dhcp6_config_file_override'
]))
{
$dhcp6cconf
=
DHCP6_Config_File_Override
(
$wancfg
,
$wanif
);
$dhcp6cfile
=
$wancfg
[
'adv_dhcp6_config_file_override_path'
];
if
(
file_exists
(
$dhcp6cfile
))
{
$dhcp6cconf
=
file_get_contents
(
$dhcp6cfile
);
$dhcp6cconf
=
DHCP6_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhcp6cconf
);
}
else
{
log_error
(
sprintf
(
'DHCP6 config file override does not exist: %s'
,
$dhcp6cfile
));
}
}
/* wide-dhcp6c works for now. */
...
...
@@ -3648,23 +3654,6 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif)
return
$dhcp6cconf
;
}
function
DHCP6_Config_File_Override
(
$wancfg
,
$wanif
)
{
$dhcp6cfile
=
$wancfg
[
'adv_dhcp6_config_file_override_path'
];
$dhcp6cconf
=
''
;
if
(
file_exists
(
$dhcp6cfile
))
{
$dhcp6cconf
=
file_get_contents
(
$dhcp6cfile
);
$dhcp6cconf
=
DHCP6_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhcp6cconf
);
}
else
{
log_error
(
sprintf
(
'DHCP6 config file override does not exist: %s'
,
$dhcp6cfile
));
}
return
$dhcp6cconf
;
}
function
DHCP6_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhcp6cconf
)
{
$dhcp6cconf
=
DHCP_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhcp6cconf
);
...
...
@@ -3745,7 +3734,13 @@ EOD;
// DHCP Config File Override
if
(
!
empty
(
$wancfg
[
'adv_dhcp_config_file_override'
]))
{
$dhclientconf
=
DHCP_Config_File_Override
(
$wancfg
,
$wanif
);
$dhclientfile
=
$wancfg
[
'adv_dhcp_config_file_override_path'
];
if
(
file_exists
(
$dhclientfile
))
{
$dhclientconf
=
file_get_contents
(
$dhclientfile
);
$dhclientconf
=
DHCP_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhclientconf
);
}
else
{
log_error
(
sprintf
(
'DHCP config file override does not exist: %s'
,
$dhclientfile
));
}
}
fwrite
(
$fd
,
$dhclientconf
);
...
...
@@ -3835,23 +3830,6 @@ function DHCP_Config_File_Advanced($interface, $wancfg, $wanif)
return
$dhclientconf
;
}
function
DHCP_Config_File_Override
(
$wancfg
,
$wanif
)
{
$dhclientfile
=
$wancfg
[
'adv_dhcp_config_file_override_path'
];
$dhclientconf
=
''
;
if
(
file_exists
(
$dhclientfile
))
{
$dhclientconf
=
file_get_contents
(
$dhclientfile
);
$dhclientconf
=
DHCP_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhclientconf
);
}
else
{
log_error
(
sprintf
(
'DHCP config file override does not exist: %s'
,
$dhclientfile
));
}
return
$dhclientconf
;
}
function
DHCP_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhclientconf
)
{
...
...
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