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
f5e93272
Commit
f5e93272
authored
May 03, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: two more replacements; almost done
parent
86033e1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
50 deletions
+33
-50
interfaces.inc
src/etc/inc/interfaces.inc
+31
-49
interfaces.lib.inc
src/etc/inc/interfaces.lib.inc
+2
-1
No files found.
src/etc/inc/interfaces.inc
View file @
f5e93272
...
...
@@ -726,32 +726,16 @@ function interface_bridge_add_member($bridgeif, $interface)
}
$options
=
pfSense_get_interface_addresses
(
$bridgeif
);
$flags_on
=
0
;
$flags_off
=
0
;
if
(
isset
(
$options
[
'encaps'
][
'txcsum'
]))
$flags_on
|=
IFCAP_TXCSUM
;
else
$flags_off
|=
IFCAP_TXCSUM
;
if
(
isset
(
$options
[
'encaps'
][
'rxcsum'
]))
$flags_on
|=
IFCAP_RXCSUM
;
else
$flags_off
|=
IFCAP_RXCSUM
;
if
(
isset
(
$options
[
'encaps'
][
'tso4'
]))
$flags_on
|=
IFCAP_TSO4
;
else
$flags_off
|=
IFCAP_TSO4
;
if
(
isset
(
$options
[
'encaps'
][
'tso6'
]))
$flags_on
|=
IFCAP_TSO6
;
else
$flags_off
|=
IFCAP_TSO6
;
if
(
isset
(
$options
[
'encaps'
][
'lro'
]))
$flags_on
|=
IFCAP_LRO
;
else
$flags_off
|=
IFCAP_LRO
;
pfSense_interface_capabilities
(
$interface
,
-
$flags_off
);
pfSense_interface_capabilities
(
$interface
,
$flags_on
);
$flags
=
sprintf
(
'%stxcsum %srxcsum %stso4 %stso6 %slro'
,
isset
(
$options
[
'encaps'
][
'txcsum'
])
?
''
:
'-'
,
isset
(
$options
[
'encaps'
][
'rxcsum'
])
?
''
:
'-'
,
isset
(
$options
[
'encaps'
][
'tso4'
])
?
''
:
'-'
,
isset
(
$options
[
'encaps'
][
'tso6'
])
?
''
:
'-'
,
isset
(
$options
[
'encaps'
][
'lro'
])
?
''
:
'-'
);
legacy_interface_flags
(
$interface
,
$flags
);
interfaces_bring_up
(
$interface
);
legacy_bridge_member
(
$bridgeif
,
$interface
);
}
...
...
@@ -821,28 +805,27 @@ function interface_lagg_configure(&$lagg)
if
(
$smallermtu
==
0
)
$smallermtu
=
1500
;
$flags_on
=
0
;
$flags_off
=
0
;
if
(
isset
(
$config
[
'system'
][
'disablechecksumoffloading'
])
||
(
$commonrx
===
false
))
$flags_off
|=
IFCAP_RXCSUM
;
else
$flags_on
|=
IFCAP_RXCSUM
;
if
(
isset
(
$config
[
'system'
][
'disablechecksumoffloading'
])
||
(
$commontx
===
false
))
$flags_off
|=
IFCAP_TXCSUM
;
else
$flags_on
|=
IFCAP_TXCSUM
;
if
(
isset
(
$config
[
'system'
][
'disablesegmentationoffloading'
])
||
(
$commontso4
===
false
))
$flags_off
|=
IFCAP_TSO4
;
else
$flags_on
|=
IFCAP_TSO4
;
if
(
isset
(
$config
[
'system'
][
'disablesegmentationoffloading'
])
||
(
$commontso6
===
false
))
$flags_off
|=
IFCAP_TSO6
;
else
$flags_on
|=
IFCAP_TSO6
;
if
(
isset
(
$config
[
'system'
][
'disablelargereceiveoffloading'
])
||
(
$commonlro
===
false
))
$flags_off
|=
IFCAP_LRO
;
else
$flags_on
|=
IFCAP_LRO
;
$flags
=
''
;
if
(
isset
(
$config
[
'system'
][
'disablechecksumoffloading'
])
||
(
$commonrx
===
false
))
{
$flags
.=
''
;
}
$flags
.=
'rxcsum '
;
if
(
isset
(
$config
[
'system'
][
'disablechecksumoffloading'
])
||
(
$commontx
===
false
))
{
$flags
.=
''
;
}
$flags
.=
'txcsum '
;
if
(
isset
(
$config
[
'system'
][
'disablesegmentationoffloading'
])
||
(
$commontso4
===
false
))
{
$flags
.=
''
;
}
$flags
.=
'tso4 '
;
if
(
isset
(
$config
[
'system'
][
'disablesegmentationoffloading'
])
||
(
$commontso6
===
false
))
{
$flags
.=
''
;
}
$flags
.=
'tso6 '
;
if
(
isset
(
$config
[
'system'
][
'disablelargereceiveoffloading'
])
||
(
$commonlro
===
false
))
{
$flags
.=
''
;
}
$flags
.=
'lro '
;
$checklist
=
get_interface_list
();
...
...
@@ -853,8 +836,7 @@ function interface_lagg_configure(&$lagg)
/* make sure the parent interface is up */
legacy_interface_mtu
(
$member
,
$smallermtu
);
pfSense_interface_capabilities
(
$member
,
-
$flags_off
);
pfSense_interface_capabilities
(
$member
,
$flags_on
);
legacy_interface_flags
(
$member
,
$flags
);
interfaces_bring_up
(
$member
);
mwexec
(
"/sbin/ifconfig
{
$laggif
}
laggport
{
$member
}
"
);
}
...
...
src/etc/inc/interfaces.lib.inc
View file @
f5e93272
...
...
@@ -52,7 +52,8 @@ function legacy_interface_listget($flag = '')
function
legacy_interface_flags
(
$ifs
,
$flag
)
{
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' '
.
escapeshellarg
(
$flag
);
/* $flags isn't escaped because it can be an argument list */
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' '
.
$flag
;
exec
(
$cmd
.
' 2>&1'
,
$out
,
$ret
);
if
(
$ret
)
{
...
...
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