Skip to content

Commit

Permalink
Merge "Check size of MAC vector before reading the element"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 7, 2015
2 parents f1eeb4e + 513b289 commit 04b1b63
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/vnsw/agent/oper/service_instance.cc
Expand Up @@ -218,17 +218,23 @@ static void FindAndSetInterfaces(
properties->interface_count++;
if(vmi_props.service_interface_type == "left") {
properties->vmi_inside = IdPermsGetUuid(vmi->id_perms());
properties->mac_addr_inside = vmi->mac_addresses().at(0);
if (vmi->mac_addresses().size()) {
properties->mac_addr_inside = vmi->mac_addresses().at(0);
}
properties->ip_addr_inside = FindInterfaceIp(graph, adj);
}
else if(vmi_props.service_interface_type == "right") {
properties->vmi_outside = IdPermsGetUuid(vmi->id_perms());
properties->mac_addr_outside = vmi->mac_addresses().at(0);
if (vmi->mac_addresses().size()) {
properties->mac_addr_outside = vmi->mac_addresses().at(0);
}
properties->ip_addr_outside = FindInterfaceIp(graph, adj);
}
else if(vmi_props.service_interface_type == "management") {
properties->vmi_management = IdPermsGetUuid(vmi->id_perms());
properties->mac_addr_management = vmi->mac_addresses().at(0);
if (vmi->mac_addresses().size()) {
properties->mac_addr_management = vmi->mac_addresses().at(0);
}
properties->ip_addr_management = FindInterfaceIp(graph, adj);
}

Expand Down

0 comments on commit 04b1b63

Please sign in to comment.