Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
edd694e1
Commit
edd694e1
authored
Feb 19, 2016
by
Mike Hibler
Browse files
Like Linux, take SPEED=0 to mean use autonegotiation on an interface.
parent
130713fa
Changes
1
Show whitespace changes
Inline
Side-by-side
clientside/tmcc/freebsd/liblocsetup.pm
View file @
edd694e1
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
# Copyright (c) 2000-201
6
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -107,8 +107,10 @@ my $IFALIAS = "$IFCONFIGBIN %s alias %s netmask %s";
my
$IFC_1000MBS
=
"
media 1000baseTX
";
my
$IFC_100MBS
=
"
media 100baseTX
";
my
$IFC_10MBS
=
"
media 10baseT/UTP
";
my
$IFC_AUTO
=
"";
my
$IFC_FDUPLEX
=
"
mediaopt full-duplex
";
my
$IFC_HDUPLEX
=
"
mediaopt half-duplex
";
my
$IFC_ADUPLEX
=
"";
my
$MKDIR
=
"
/bin/mkdir
";
my
$GATED
=
"
/usr/local/sbin/gated
";
my
$ROUTE
=
"
/sbin/route
";
...
...
@@ -177,7 +179,7 @@ sub os_ifconfig_line($$$$$$$$;$$%)
}
if
(
$speed
==
10000
)
{
# 10G is 10G, take it or leave it
$media
=
""
;
$media
=
$IFC_AUTO
;
}
elsif
(
$speed
==
1000
)
{
$media
=
$IFC_1000MBS
;
...
...
@@ -188,17 +190,23 @@ sub os_ifconfig_line($$$$$$$$;$$%)
elsif
(
$speed
==
10
)
{
$media
=
$IFC_10MBS
;
}
elsif
(
$speed
==
0
)
{
$media
=
$IFC_AUTO
;
}
else
{
warn
("
*** Bad Speed
$speed
in ifconfig, default to
100Mbps
\n
");
$speed
=
10
0
;
$media
=
$IFC_
100MBS
;
warn
("
*** Bad Speed
$speed
in ifconfig, default to
autoconfig
\n
");
$speed
=
0
;
$media
=
$IFC_
AUTO
;
}
}
if
(
$media
eq
$IFC_AUTO
)
{
$mediaopt
=
$IFC_ADUPLEX
;
}
else
{
if
(
$duplex
eq
"
full
")
{
if
(
$speed
==
10000
)
{
# 10G is always full duplex, no need to set
$mediaopt
=
""
;
$mediaopt
=
$IFC_ADUPLEX
;
}
else
{
$mediaopt
=
$IFC_FDUPLEX
;
}
...
...
@@ -212,6 +220,7 @@ sub os_ifconfig_line($$$$$$$$;$$%)
$mediaopt
=
$IFC_FDUPLEX
;
}
}
}
$uplines
=
"";
...
...
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