Commit 9437e63a authored by Mike Hibler's avatar Mike Hibler
Browse files

sanity check: make sure frisbee_pid is set if loadaddr is non-null

parent 21f2c6b7
......@@ -1053,6 +1053,15 @@ sub setjailoptions() {
}
last SWITCH;
};
/^IPFW$/ && do {
if ($val) {
$jailoptions .= " -o ipfw";
}
else {
$jailoptions .= " -o noipfw";
}
last SWITCH;
};
/^DEVMEM$/ && do {
$jailflags |= $JAIL_DEVMEM;
last SWITCH;
......@@ -1089,6 +1098,7 @@ sub setjailoptions() {
system("sysctl jail.bpf_allowed=1 >/dev/null 2>&1");
system("sysctl jail.inaddrany_allowed=1 >/dev/null 2>&1");
system("sysctl jail.multiip_allowed=1 >/dev/null 2>&1");
system("sysctl jail.ipfw_allowed=1 >/dev/null 2>&1");
system("sysctl net.link.ether.inet.useloopback=0 >/dev/null 2>&1");
if ($?) {
......
......@@ -3199,12 +3199,12 @@ COMMAND_PROTOTYPE(doloadinfo)
/*
* Get the address the node should contact to load its image
*/
res = mydb_query("select load_address,loadpart,OS "
res = mydb_query("select load_address,loadpart,OS,frisbee_pid "
" from current_reloads as r "
"left join images as i on i.imageid = r.image_id "
"left join os_info as o on i.default_osid = o.osid "
"where node_id='%s'",
3, reqp->nodeid);
4, reqp->nodeid);
if (!res) {
error("doloadinfo: %s: DB Error getting loading address!\n",
......@@ -3226,6 +3226,15 @@ COMMAND_PROTOTYPE(doloadinfo)
return 0;
}
/*
* Sanity check
*/
if (!row[3] || !row[3][0]) {
error("doloadinfo: %s: No pid associated with address %s\n",
reqp->nodeid, row[0]);
return 1;
}
bufp += OUTPUT(bufp, ebufp - bufp,
"ADDR=%s PART=%s PARTOS=%s", row[0], row[1], row[2]);
mysql_free_result(res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment