*outport_id = p_nat->outport_id[dest_if];
ret_arp_data = get_dest_mac_addr_ipv4(nhip,
- dest_if, (struct ether_addr *)eth_dest);
+ dest_if, (struct ether_addr *)&hw_addr);
if (unlikely(ret_arp_data == NULL)) {
src_port = RTE_MBUF_METADATA_UINT16_PTR(pkt, src_port_offset);
dst_port = RTE_MBUF_METADATA_UINT16_PTR(pkt, dst_port_offset);
break;
+ default: /* KW fix: unknown is treated as TCP/UDP */
+ src_port_offset = SRC_PRT_OFST_IP4_TCP;
+ dst_port_offset = DST_PRT_OFST_IP4_TCP;
+ src_port = RTE_MBUF_METADATA_UINT16_PTR(pkt, src_port_offset);
+ dst_port = RTE_MBUF_METADATA_UINT16_PTR(pkt, dst_port_offset);
+ break;
}
uint8_t *eth_dest = RTE_MBUF_METADATA_UINT8_PTR(pkt, MBUF_HDR_ROOM);
dst_port = RTE_MBUF_METADATA_UINT16_PTR(pkt,
dst_port_offset);
break;
+ default: /* KW fix: unknown is treated as TCP/UDP */
+ src_port_offset = SRC_PRT_OFST_IP4_TCP;
+ dst_port_offset = DST_PRT_OFST_IP4_TCP;
+ src_port = RTE_MBUF_METADATA_UINT16_PTR(pkt,
+ src_port_offset);
+ dst_port = RTE_MBUF_METADATA_UINT16_PTR(pkt,
+ dst_port_offset);
+ break;
}
all_pipeline_cgnapt[n_cgnapt_pipeline++] = p_nat;
- strcpy(p->name, params->name);
+ strncpy(p->name, params->name,PIPELINE_NAME_SIZE);
p->log_level = params->log_level;
PLOG(p, HIGH, "CG-NAPT");
len += sprintf(buf + len, "egress %" PRIu64 "\n", p_nat->enaptedPktCount);
len += sprintf(buf + len, "arpicmp pkts %" PRIu64 "\n", p_nat->arpicmpPktCount);
- printf("\nCG-NAPT Packet Stats:\n");
+ printf("\nCG-NAPT Packet Stats:\n");
printf("pipeline %d stats:\n", p_nat->pipeline_num);
printf("Received %" PRIu64 ",", p_nat->receivedPktCount);
printf("Missed %" PRIu64 ",", p_nat->missedPktCount);
len += sprintf(buf + len, "egress %" PRIu64 "\n", enaptedPktCount);
len += sprintf(buf + len, "arpicmp pkts %" PRIu64 "\n", arpicmpPktCount);
- printf("\nTotal pipeline stats:\n");
+ printf("\nTotal pipeline stats:\n");
printf("Received %" PRIu64 ",", receivedPktCount);
printf("Missed %" PRIu64 ",", missedPktCount);
printf("Dropped %" PRIu64 ",", naptDroppedPktCount);