From 29a1343463d895dd6e2c579f89245d2d51b74487 Mon Sep 17 00:00:00 2001 From: Prabhjot Singh Sethi Date: Fri, 4 Mar 2016 14:57:52 +0530 Subject: [PATCH] Allow DHCP to go through when bridging is disabled 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 --- src/vnsw/agent/pkt/pkt_handler.cc | 40 +++++++++++++------------------ 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/vnsw/agent/pkt/pkt_handler.cc b/src/vnsw/agent/pkt/pkt_handler.cc index 79e42767bc6..02121c55717 100644 --- a/src/vnsw/agent/pkt/pkt_handler.cc +++ b/src/vnsw/agent/pkt/pkt_handler.cc @@ -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(intf); if (pkt_info->l3_forwarding && vm_itf->layer3_forwarding() == false) { @@ -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; @@ -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;