Commit b787ecab authored by Leigh B Stoller's avatar Leigh B Stoller

Return mac address for jail control interface, if it exists and is

not 000000000000.
parent 2be10d86
...@@ -6831,12 +6831,13 @@ COMMAND_PROTOTYPE(dojailconfig) ...@@ -6831,12 +6831,13 @@ COMMAND_PROTOTYPE(dojailconfig)
* created before we switched to creating real interface entries * created before we switched to creating real interface entries
* for jailed nodes. * for jailed nodes.
*/ */
res = mydb_query("select n.sshdport,n.jailip,n.jailipmask,i.IP,i.mask " res = mydb_query("select n.sshdport,n.jailip,n.jailipmask,"
" i.IP,i.mask,i.mac "
" from nodes as n " " from nodes as n "
"left join interfaces as i on " "left join interfaces as i on "
" i.node_id=n.node_id and i.role='ctrl' " " i.node_id=n.node_id and i.role='ctrl' "
"where n.node_id='%s'", "where n.node_id='%s'",
5, reqp->nodeid); 6, reqp->nodeid);
if (!res) { if (!res) {
error("JAILCONFIG: %s: DB Error getting config!\n", error("JAILCONFIG: %s: DB Error getting config!\n",
...@@ -6863,6 +6864,10 @@ COMMAND_PROTOTYPE(dojailconfig) ...@@ -6863,6 +6864,10 @@ COMMAND_PROTOTYPE(dojailconfig)
bufp += OUTPUT(bufp, ebufp - bufp, bufp += OUTPUT(bufp, ebufp - bufp,
"JAILIP=\"%s,%s\"\n", jailip, jailipmask); "JAILIP=\"%s,%s\"\n", jailip, jailipmask);
} }
if (row[5] && strcmp(row[5], "000000000000")) {
bufp += OUTPUT(bufp, ebufp - bufp,
"CTRLMAC=\"%s\"\n", row[5]);
}
bufp += OUTPUT(bufp, ebufp - bufp, bufp += OUTPUT(bufp, ebufp - bufp,
"PORTRANGE=\"%d,%d\"\n" "PORTRANGE=\"%d,%d\"\n"
"SSHDPORT=%d\n" "SSHDPORT=%d\n"
......
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