Having version and ihl set to 0 would result in a
corrupted/incorrect encapsulating packet for MPLS,
this commit sets these fields to 4 and 5 respectively
as defined in librte_net/rte_ip.h.
Fixes:
3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes:
a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation")
Cc: stable@dpdk.org
Signed-off-by: Saleh Alsouqi <salehals@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
.src_addr = mplsogre_encap_conf.ipv4_src,
.dst_addr = mplsogre_encap_conf.ipv4_dst,
.next_proto_id = IPPROTO_GRE,
.src_addr = mplsogre_encap_conf.ipv4_src,
.dst_addr = mplsogre_encap_conf.ipv4_dst,
.next_proto_id = IPPROTO_GRE,
+ .version_ihl = RTE_IPV4_VHL_DEF,
+ .time_to_live = IPDEFTTL,
},
};
struct rte_flow_item_ipv6 ipv6 = {
.hdr = {
.proto = IPPROTO_GRE,
},
};
struct rte_flow_item_ipv6 ipv6 = {
.hdr = {
.proto = IPPROTO_GRE,
+ .hop_limits = IPDEFTTL,
},
};
struct rte_flow_item_gre gre = {
},
};
struct rte_flow_item_gre gre = {
.src_addr = mplsoudp_encap_conf.ipv4_src,
.dst_addr = mplsoudp_encap_conf.ipv4_dst,
.next_proto_id = IPPROTO_UDP,
.src_addr = mplsoudp_encap_conf.ipv4_src,
.dst_addr = mplsoudp_encap_conf.ipv4_dst,
.next_proto_id = IPPROTO_UDP,
+ .version_ihl = RTE_IPV4_VHL_DEF,
+ .time_to_live = IPDEFTTL,
},
};
struct rte_flow_item_ipv6 ipv6 = {
.hdr = {
.proto = IPPROTO_UDP,
},
};
struct rte_flow_item_ipv6 ipv6 = {
.hdr = {
.proto = IPPROTO_UDP,
+ .hop_limits = IPDEFTTL,
},
};
struct rte_flow_item_udp udp = {
},
};
struct rte_flow_item_udp udp = {