Skip to content
GitLab
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
ebde4452
Commit
ebde4452
authored
Jan 17, 2002
by
Mike Hibler
Browse files
changes to enable IPoD in BSD kernels via sysctl
parent
b22895c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/freebsd/liblocsetup.pm
View file @
ebde4452
...
...
@@ -10,7 +10,7 @@ use Exporter;
qw (
$CP
$EGREP
$MOUNT
$UMOUNT
$TMPASSWD
os_cleanup_node
os_ifconfig_line
os_etchosts_line
os_setup
os_groupadd
os_useradd
os_userdel
os_usermod
os_mkdir
os_rpminstall_line
update_delays
os_rpminstall_line
update_delays
enable_ipod
);
# Must come after package declaration!
...
...
@@ -396,4 +396,34 @@ sub dodelays ()
return
0
;
}
use
Socket
;
sub
enable_ipod
()
{
if
(
system
("
sysctl net.inet.icmp.ipod_host
"))
{
warn
"
*** WARNING: IPOD sysctls not supported in the kernel
\n
";
return
-
1
;
}
my
(
$bname
,
$bip
)
=
split
(
/ /
,
`
/etc/testbed/tmcc bossinfo
`);
if
(
!
defined
(
$bip
))
{
warn
"
*** WARNING: could not determine boss node, IPOD not enabled
\n
";
return
-
1
;
}
my
$ipuint
=
unpack
("
N
",
inet_aton
(
$bip
));
# XXX arg to sysctl must be a signed 32-bit int, so we must "cast"
my
$sysctlcmd
=
sprintf
("
sysctl -w net.inet.icmp.ipod_host=%d
",
$ipuint
);
if
(
system
(
$sysctlcmd
))
{
warn
"
*** WARNING: could not set IPOD host to
$bip
(
$ipuint
)
\n
";
return
-
1
;
}
if
(
system
("
sysctl -w net.inet.icmp.ipod_enabled=1
"))
{
warn
"
*** WARNING: could not enable IPOD
\n
";
return
-
1
;
}
return
0
;
}
1
;
tmcd/freebsd/setup
View file @
ebde4452
...
...
@@ -20,4 +20,9 @@ use libsetup;
#
bootsetup
();
#
# Enable ICMP ping-of-death
#
liblocsetup::
enable_ipod
();
exit
0
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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