Skip to content

Commit

Permalink
Allow DHCP to go through when bridging is disabled
Browse files Browse the repository at this point in the history
Issue:
------
For an Interface with Health Check down, agent disables
bridging for it. further pkt module looks for bridging
enabled to allow DHCP to go through, cause a dead lock
and health check will stay in failed state unless
removed and re-added

Fix:
----
Allow DHCP request to go through even if bridging is
disabled

Closes-Bug: 1551453
Change-Id: Ibf86bfb4f04389b66f9b1458c43fd79061afd3c1
  • Loading branch information
Prabhjot Singh Sethi committed Mar 4, 2016
1 parent d2fcb8c commit 29a1343
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions src/vnsw/agent/pkt/pkt_handler.cc
Original file line number Diff line number Diff line change
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 29a1343

Please sign in to comment.