From 3ae57ffdc591f183763adae582de53546bbb791c Mon Sep 17 00:00:00 2001 From: Divakar D Date: Fri, 21 Oct 2016 11:38:47 +0530 Subject: [PATCH] Calcaulte udp source port for multicast pkt using right hash While calculating the UDP source port for a multicast packet, the hash needs to be on Ethernet header and VRF Id. For packet arriving from VM and Tor, there are no extra header other than transport headers. So the hash is calculated rightly for these packets. But for packets arriving from other compute node, there are additional header other than transport headers. The hash is wrongly calculated in this case on thsese additional headers leading to different hash for the same Ethernet headers, resulting in different UDP sourcd port. The offset is correctly calculated and right ethernet header is passed to hash function as fix. Change-Id: I93ae0d96e536875988da6a525cdba4783c1e4d6e closes-bug: #1635046 --- dp-core/vr_nexthop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dp-core/vr_nexthop.c b/dp-core/vr_nexthop.c index 0078f5bc9..90ffa7e1e 100644 --- a/dp-core/vr_nexthop.c +++ b/dp-core/vr_nexthop.c @@ -906,7 +906,7 @@ nh_composite_mcast_l2(struct vr_packet *pkt, struct vr_nexthop *nh, get_random_bytes(&vr_hashrnd, sizeof(vr_hashrnd)); hashrnd_inited = 1; } - hashval = vr_hash(pkt_data(pkt), sizeof(struct vr_eth), vr_hashrnd); + hashval = vr_hash(eth, sizeof(struct vr_eth), vr_hashrnd); /* Include the VRF to calculate the hash */ hashval = vr_hash_2words(hashval, fmd->fmd_dvrf, vr_hashrnd);