Skip to content

Commit

Permalink
Merge "Allow DHCP to go through when bridging is disabled"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 5, 2016
2 parents 935058e + 29a1343 commit 84f7cd3
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions src/vnsw/agent/pkt/pkt_handler.cc
Expand Up @@ -162,6 +162,21 @@ PktHandler::PktModuleName PktHandler::ParsePacket(const AgentHdr &hdr,
// Compute L2/L3 forwarding mode for packet
pkt_info->l3_forwarding = ComputeForwardingMode(pkt_info);

pkt_info->vrf = pkt_info->agent_hdr.vrf;

// Look for DHCP packets if corresponding service is enabled
// Service processing over-rides ACL/Flow and forwarding configuration
if (intf->dhcp_enabled() && (pkt_type == PktType::UDP)) {
if (pkt_info->dport == DHCP_SERVER_PORT ||
pkt_info->sport == DHCP_CLIENT_PORT) {
return DHCP;
}
if (pkt_info->dport == DHCPV6_SERVER_PORT ||
pkt_info->sport == DHCPV6_CLIENT_PORT) {
return DHCPV6;
}
}

if (intf->type() == Interface::VM_INTERFACE) {
VmInterface *vm_itf = static_cast<VmInterface *>(intf);
if (pkt_info->l3_forwarding && vm_itf->layer3_forwarding() == false) {
Expand All @@ -178,19 +193,14 @@ PktHandler::PktModuleName PktHandler::ParsePacket(const AgentHdr &hdr,
}
}

pkt_info->vrf = pkt_info->agent_hdr.vrf;

// Handle ARP packet
if (pkt_type == PktType::ARP) {
return ARP;
}

if (IsFlowPacket(pkt_info)) {
CalculatePort(pkt_info);
}

// Packets needing flow
if (IsFlowPacket(pkt_info)) {
CalculatePort(pkt_info);
if ((pkt_info->ip && pkt_info->family == Address::INET) ||
(pkt_info->ip6 && pkt_info->family == Address::INET6)) {
return FLOW;
Expand All @@ -201,24 +211,8 @@ PktHandler::PktModuleName PktHandler::ParsePacket(const AgentHdr &hdr,
}
}

// Handle ARP packet
if (pkt_type == PktType::ARP) {
return ARP;
}

// Look for DHCP and DNS packets if corresponding service is enabled
// Look for DNS packets if corresponding service is enabled
// Service processing over-rides ACL/Flow
if (intf->dhcp_enabled() && (pkt_type == PktType::UDP)) {
if (pkt_info->dport == DHCP_SERVER_PORT ||
pkt_info->sport == DHCP_CLIENT_PORT) {
return DHCP;
}
if (pkt_info->dport == DHCPV6_SERVER_PORT ||
pkt_info->sport == DHCPV6_CLIENT_PORT) {
return DHCPV6;
}
}

if (intf->dns_enabled() && (pkt_type == PktType::UDP)) {
if (pkt_info->dport == DNS_SERVER_PORT) {
return DNS;
Expand Down

0 comments on commit 84f7cd3

Please sign in to comment.