Skip to content

Commit

Permalink
cnet-chnl: return EPROTONOSUPPORT if chnl type is unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Jalal Mostafa <[email protected]>
  • Loading branch information
jalalmostafa authored and KeithWiles committed Jul 11, 2024
1 parent 807d16a commit 65c4c6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/cnet/chnl/cnet_chnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ initialize_chnl(struct chnl *ch, int typ)
pcb->opt_flag |= UDP_CHKSUM_FLAG;

ch->ch_proto->proto = IPPROTO_UDP;
} else {
} else if (typ == SOCK_STREAM) {
rb->cb_size = rb->cb_hiwat = stk->tcp->rcv_size;
sb->cb_size = sb->cb_hiwat = stk->tcp->snd_size;
rb->cb_lowat = sb->cb_lowat = 1;
Expand All @@ -258,7 +258,8 @@ initialize_chnl(struct chnl *ch, int typ)
return __errno_set(ENOBUFS);

ch->ch_proto->proto = IPPROTO_TCP;
}
} else
return __errno_set(EPROTONOSUPPORT);

pcb->ch = ch;
ch->ch_pcb = pcb;
Expand Down
2 changes: 1 addition & 1 deletion lib/cnet/tcp/cnet_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,7 @@ cnet_tcp_input(struct pcb_entry *pcb, pktmbuf_t *mbuf)

free_seg:
free_seg(seg);
CNE_DEBUG("Leave\n\n");
CNE_DEBUG("Leave\n");
return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/usr/clib/graph/cne_graph_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ cne_node_next_stream_move(struct cne_graph *graph, struct cne_node *src, cne_edg
{
struct cne_node *dst = __cne_node_next_node_get(src, next);

CNE_DEBUG("Src %-16s', Dst '%-16s' next %d\n", src->name, dst->name, next);
CNE_DEBUG("Src '%-16s', Dst '%-16s' next %d\n", src->name, dst->name, next);

/* Swap the pointers if dst doesn't have valid objs */
if (likely(dst->idx == 0)) {
Expand Down

0 comments on commit 65c4c6f

Please sign in to comment.