Fix PROX generator latency
[samplevnf.git] / VNFs / DPPD-PROX / handle_cgnat.c
index d79a6d5..0aa6876 100644 (file)
@@ -45,8 +45,6 @@
 #define BIT_8_TO_15 0x0000ff00
 #define BIT_0_TO_15 0x0000ffff
 
-#define IP4(x) x & 0xff, (x >> 8) & 0xff, (x >> 16) & 0xff, x >> 24
-
 struct private_key {
                uint32_t ip_addr;
                uint16_t l4_port;
@@ -961,7 +959,7 @@ static void init_task_nat(struct task_base *tbase, struct task_args *targ)
 
        struct prox_port_cfg *port = find_reachable_port(targ);
        if (port) {
-               task->offload_crc = port->capabilities.tx_offload_cksum;
+               task->offload_crc = port->requested_tx_offload & (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM);
        }
 }