Skip to content

Commit

Permalink
* In case of IPv6 ICMP errors parse thru inner payload
Browse files Browse the repository at this point in the history
  and frame the flow key.
Closes-bug:#1542207

Change-Id: I66793922b0bba02c43c9eebde86bafa7e8035e9e
  • Loading branch information
naveen-n committed Feb 26, 2016
1 parent 0c3b917 commit d5fb908
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/vnsw/agent/pkt/pkt_handler.cc
Expand Up @@ -454,6 +454,21 @@ int PktHandler::ParseIpPacket(PktInfo *pkt_info, PktType::Type &pkt_type,
icmp->icmp6_type == ICMP6_ECHO_REPLY) {
pkt_info->dport = ICMP6_ECHO_REPLY;
pkt_info->sport = htons(icmp->icmp6_id);
} else if (IsFlowPacket(pkt_info) &&
icmp->icmp6_type < ICMP6_ECHO_REQUEST) {
//Agent has to look at inner payload
//and recalculate the parameter
//Handle this only for packets requiring flow miss
ParseIpPacket(pkt_info, pkt_type, pkt + len + sizeof(icmp));
//Swap the key parameter, which would be used as key
IpAddress src_ip = pkt_info->ip_saddr;
pkt_info->ip_saddr = pkt_info->ip_daddr;
pkt_info->ip_daddr = src_ip;
if (pkt_info->ip_proto != IPPROTO_ICMPV6) {
uint16_t port = pkt_info->sport;
pkt_info->sport = pkt_info->dport;
pkt_info->dport = port;
}
} else {
pkt_info->sport = 0;
}
Expand Down

0 comments on commit d5fb908

Please sign in to comment.