Commit 320dfab4 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

ElabInElab fix: Remove use of control_iface in iptonodeid (the initial

query that maps the peer IP to a node in the DB). This was primarily
used as a safety to make sure that the node_types entry really did
match (in case the luser picked experimental addresses that conflicted
with real testbed addresses?), but not sure this test really
mattered. But, just to be safe, I changed it so that we check for a
matching IP and role='ctrl'.
parent a39e0c7d
...@@ -3766,15 +3766,15 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp) ...@@ -3766,15 +3766,15 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp)
"left join experiments as e on " "left join experiments as e on "
" e.pid=r.pid and e.eid=r.eid " " e.pid=r.pid and e.eid=r.eid "
"left join node_types as pt on " "left join node_types as pt on "
" pt.type=np.type and " " pt.type=np.type "
" i.iface=pt.control_iface "
"left join node_types as vt on " "left join node_types as vt on "
" vt.type=nv.type " " vt.type=nv.type "
"left join plab_slices as ps on " "left join plab_slices as ps on "
" ps.pid=e.pid and ps.eid=e.eid " " ps.pid=e.pid and ps.eid=e.eid "
"left join node_hostkeys as nk on " "left join node_hostkeys as nk on "
" nk.node_id=nv.node_id " " nk.node_id=nv.node_id "
"where nv.node_id='%s' and i.IP='%s'", "where nv.node_id='%s' and "
" (i.IP='%s' and i.role='ctrl') ",
25, reqp->vnodeid, inet_ntoa(ipaddr)); 25, reqp->vnodeid, inet_ntoa(ipaddr));
} }
else { else {
...@@ -3793,10 +3793,10 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp) ...@@ -3793,10 +3793,10 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp)
"left join experiments as e on " "left join experiments as e on "
" e.pid=r.pid and e.eid=r.eid " " e.pid=r.pid and e.eid=r.eid "
"left join node_types as t on " "left join node_types as t on "
" t.type=n.type and i.iface=t.control_iface " " t.type=n.type "
"left join node_hostkeys as nk on " "left join node_hostkeys as nk on "
" nk.node_id=n.node_id " " nk.node_id=n.node_id "
"where i.IP='%s'", "where i.IP='%s' and i.role='ctrl'", /*XXX*/
25, inet_ntoa(ipaddr)); 25, inet_ntoa(ipaddr));
} }
......
Supports Markdown
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