Skip to content

Commit

Permalink
Merge "Do not swap ports for an ICMP packet inside an ICMP error"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 15, 2016
2 parents 7481ce1 + afec864 commit 81ac86b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dp-core/vr_proto_ip.c
Expand Up @@ -723,9 +723,11 @@ vr_inet_flow_swap(struct vr_flow *key_p)
unsigned short port;
unsigned int ipaddr;

port = key_p->flow4_sport;
key_p->flow4_sport = key_p->flow4_dport;
key_p->flow4_dport = port;
if (key_p->flow4_proto != VR_IP_PROTO_ICMP) {
port = key_p->flow4_sport;
key_p->flow4_sport = key_p->flow4_dport;
key_p->flow4_dport = port;
}

ipaddr = key_p->flow4_sip;
key_p->flow4_sip = key_p->flow4_dip;
Expand Down
8 changes: 5 additions & 3 deletions dp-core/vr_proto_ip6.c
Expand Up @@ -140,9 +140,11 @@ vr_inet6_flow_swap(struct vr_flow *key_p)
unsigned short port;
uint8_t ip6_addr[VR_IP6_ADDRESS_LEN];

port = key_p->flow6_sport;
key_p->flow6_sport = key_p->flow6_dport;
key_p->flow6_dport = port;
if (key_p->flow6_proto != VR_IP_PROTO_ICMP6) {
port = key_p->flow6_sport;
key_p->flow6_sport = key_p->flow6_dport;
key_p->flow6_dport = port;
}

memcpy(ip6_addr, key_p->flow6_sip, VR_IP6_ADDRESS_LEN);
memcpy(key_p->flow6_sip, key_p->flow6_dip, VR_IP6_ADDRESS_LEN);
Expand Down

0 comments on commit 81ac86b

Please sign in to comment.