Skip to content

Commit

Permalink
cnet: tcp/udp input s/csum/verify
Browse files Browse the repository at this point in the history
Signed-off-by: Maryam Tahhan <[email protected]>
  • Loading branch information
maryamtahhan authored and KeithWiles committed Sep 28, 2023
1 parent 4e38ed8 commit cd242ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/cnet/tcp/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tcp_input_lookup(struct cne_node *node, pktmbuf_t *m, struct pcb_hd *hd)
struct pcb_key key = {0};
struct pcb_entry *pcb;
struct cnet_metadata *md;
int16_t csum;
int16_t verify;
int a_family, a_len;
struct pcb_entry *pcb2;

Expand Down Expand Up @@ -96,10 +96,10 @@ tcp_input_lookup(struct cne_node *node, pktmbuf_t *m, struct pcb_hd *hd)
if (likely(pcb)) {
int rc = TCP_INPUT_NEXT_PKT_DROP;
if (is_pcb_dom_inet6(pcb))
csum = cne_ipv6_udptcp_cksum_verify(l3, tcp);
verify = cne_ipv6_udptcp_cksum_verify(l3, tcp);
else
csum = cne_ipv4_udptcp_cksum_verify(l3, tcp);
if (csum < 0)
verify = cne_ipv4_udptcp_cksum_verify(l3, tcp);
if (verify < 0)
return rc;

m->userptr = pcb;
Expand Down
8 changes: 4 additions & 4 deletions lib/cnet/udp/udp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ udp_input_lookup(pktmbuf_t *m, struct pcb_hd *hd)
struct pcb_key key = {0};
struct pcb_entry *pcb;
struct cnet_metadata *md;
int16_t csum;
int16_t verify;
int a_family, a_len;
struct pcb_entry *pcb2;

Expand Down Expand Up @@ -100,11 +100,11 @@ udp_input_lookup(pktmbuf_t *m, struct pcb_hd *hd)
if (likely(pcb)) {
if ((pcb->opt_flag & UDP_CHKSUM_FLAG) && udp->dgram_cksum) {
if (is_pcb_dom_inet6(pcb))
csum = cne_ipv6_udptcp_cksum_verify(l3, udp);
verify = cne_ipv6_udptcp_cksum_verify(l3, udp);
else {
csum = cne_ipv4_udptcp_cksum_verify(l3, udp);
verify = cne_ipv4_udptcp_cksum_verify(l3, udp);
}
if (csum < 0)
if (verify < 0)
return UDP_INPUT_NEXT_PKT_DROP;
}
m->userptr = pcb;
Expand Down

0 comments on commit cd242ba

Please sign in to comment.