Commit 33d60ba5 authored by David Johnson's avatar David Johnson

Fix csw uplink port type to be unsigned.

parent 188512bf
Pipeline #1937 passed with stage
......@@ -1001,13 +1001,13 @@ static int __cnc_domain_setup_node_dhcp_flows(cn_node_t *dhcpnode,
* uplinks on both switches; otherwise we will wait til the uplinks
* are in place before we install.
*/
if (!(cswn == cswd || (cswn->uplink && cswn->uplink_port_no > -1))) {
if (!(cswn == cswd || (cswn->uplink && cswn->uplink_port_no > 0))) {
cncwarn("cannot not setup DHCP flow from node %s to server %s;"
" node switch has no uplink\n",node->name,dhcpnode->name);
ret = -2;
goto finish;
}
if (!(cswn == cswd || (cswd->uplink && cswd->uplink_port_no > -1))) {
if (!(cswn == cswd || (cswd->uplink && cswd->uplink_port_no > 0))) {
cncwarn("cannot not setup DHCP flow from dhcpnode %s to node %s;"
" node switch has no uplink\n",dhcpnode->name,node->name);
ret = -2;
......@@ -1019,7 +1019,7 @@ static int __cnc_domain_setup_node_dhcp_flows(cn_node_t *dhcpnode,
*/
if (cswn == cswd)
outport = portd->port_no;
else if (cswn->uplink && cswn->uplink_port_no > -1)
else if (cswn->uplink && cswn->uplink_port_no > 0)
outport = cswn->uplink_port_no;
else {
cncerr("could not setup DHCP flow from node %s to server %s;"
......@@ -1122,7 +1122,7 @@ static int __cnc_domain_setup_node_dhcp_flows(cn_node_t *dhcpnode,
*/
if (cswn == cswd)
outport = portn->port_no;
else if (cswd->uplink && cswd->uplink_port_no > -1)
else if (cswd->uplink && cswd->uplink_port_no > 0)
outport = cswd->uplink_port_no;
else {
cncerr("could not setup DHCP flow from dhcpnode %s to node %s;"
......@@ -1265,7 +1265,7 @@ static int __cnc_domain_setup_node_osmeta_flows(cn_node_t *osmetanode,
/* First, setup the flow from the source to the metadata server. */
if (cswn == cswd)
outport = portd->port_no;
else if (cswn->uplink && cswn->uplink_port_no > -1)
else if (cswn->uplink && cswn->uplink_port_no > 0)
outport = cswn->uplink_port_no;
else {
cncerr("could not setup OpenStack metadata flow from node %s to server %s;"
......@@ -1315,7 +1315,7 @@ static int __cnc_domain_setup_node_osmeta_flows(cn_node_t *osmetanode,
/* Second, setup the flow from the metadata server to the node. */
if (cswn == cswd)
outport = portn->port_no;
else if (cswd->uplink && cswd->uplink_port_no > -1)
else if (cswd->uplink && cswd->uplink_port_no > 0)
outport = cswd->uplink_port_no;
else {
cncerr("could not setup OpenStack metadata flow from metadata server %s"
......@@ -1735,7 +1735,7 @@ void cnc_priv_port_free(void *priv) {
if (cport->role == CN_PORT_ROLE_UPLINK) {
cport->csw->uplink = NULL;
cport->csw->uplink_port_no = -1;
cport->csw->uplink_port_no = 0;
RPUTs_OBJ(cport,cport->csw);
}
......@@ -1924,7 +1924,7 @@ static void cnc_dhcp_discovery_handler(mul_switch_t *sw,struct flow *fl,
if (dhcpnode->cn_port->csw == csw) {
outport = dhcpnode->cn_port->mul_port->port_no;
}
else if (csw->uplink && csw->uplink_port_no > -1)
else if (csw->uplink && csw->uplink_port_no > 0)
outport = csw->uplink_port_no;
else {
cncwarn("could not forward DHCP discovery from node %s to server %s;"
......
......@@ -253,7 +253,7 @@ struct cn_switch {
* we don't loop.
*/
cn_port_t *uplink;
int32_t uplink_port_no;
uint32_t uplink_port_no;
/**
* The metadata service ops for this switch, and its private state.
......
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