From acd4d787128d404fc23fe9c94bb2b7ee92cbbe45 Mon Sep 17 00:00:00 2001 From: Jalal Mostafa Date: Tue, 11 Jun 2024 21:51:46 +0200 Subject: [PATCH] channels: accept channel 0 in chnl_connect Signed-off-by: Jalal Mostafa --- lib/cnet/chnl/cnet_chnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cnet/chnl/cnet_chnl.c b/lib/cnet/chnl/cnet_chnl.c index 7f61f5e6..3e46cbd1 100644 --- a/lib/cnet/chnl/cnet_chnl.c +++ b/lib/cnet/chnl/cnet_chnl.c @@ -483,10 +483,10 @@ chnl_connect(int cd, struct sockaddr *sa, int namelen) struct protosw_entry *psw; struct in_caddr faddr = {0}; - if (!cd || this_stk == NULL) + if (!ch || this_stk == NULL) return __errno_set(EFAULT); - if (!name || (namelen > (int)sizeof(struct in_caddr)) || !ch || !ch->ch_proto) + if (!name || (namelen > (int)sizeof(struct in_caddr)) || !ch->ch_proto) CNE_ERR_RET_VAL(__errno_set(EINVAL), "Channel name %p or len %d != %ld\n", name, namelen, sizeof(struct in_caddr));