ether_addr_copy(ð_hdr->s_addr, &tmp.s_addr);
ether_addr_copy(ð_hdr->d_addr, ð_hdr->s_addr);
ether_addr_copy(&tmp.s_addr, ð_hdr->d_addr);
+ struct ether_hdr *eth_h = rte_pktmbuf_mtod(m, struct ether_hdr *);
- if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
+ if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv4) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
sizeof(struct ether_hdr));
udp_hdr->src_port = temp_udp.dst_port;
send_single_packet(m, dst_port);
- } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+ } else if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv6) {
/* Handle IPv6 headers.*/
struct ipv6_hdr *ipv6_hdr,temp_ipv6;
uint8_t next_hop;
struct ipv6_hdr *ipv6_hdr;
struct ether_hdr *eth_hdr;
+ struct ether_hdr *eth_h = rte_pktmbuf_mtod(m, struct ether_hdr *);
- if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
+ if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv4) {
if (rte_lpm_lookup(qconf->ipv4_lookup_struct, dst_ipv4,
&next_hop) != 0)
next_hop = portid;
- } else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
+ } else if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv6) {
eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
if (rte_lpm6_lookup(qconf->ipv6_lookup_struct,