diff --git a/dp-core/vr_proto_ip.c b/dp-core/vr_proto_ip.c index 543126761..29a875b42 100644 --- a/dp-core/vr_proto_ip.c +++ b/dp-core/vr_proto_ip.c @@ -857,9 +857,13 @@ vr_inet_proto_flow(struct vrouter *router, unsigned short vrf, sport = 0; dport = icmph->icmp_type; } - } else { + } else if ((ip->ip_proto == VR_IP_PROTO_TCP) || + (ip->ip_proto == VR_IP_PROTO_UDP)) { sport = *t_hdr; dport = *(t_hdr + 1); + } else { + sport = 0; + dport = 0; } nh_id = vr_inet_flow_nexthop(pkt, vlan);