vcl: fix return value check for ldp_fd_to_vlsh 04/33004/2
authorwanghanlin <wanghanlin@corp.netease.com>
Tue, 6 Jul 2021 07:01:48 +0000 (15:01 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 6 Jul 2021 14:23:42 +0000 (14:23 +0000)
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Iaad4022e84f4979016bb46c2ff5cfc5d43d6ff50

src/vcl/ldp.c

index 316d97d..5edb935 100644 (file)
@@ -1603,7 +1603,7 @@ sendto (int fd, const void *buf, size_t n, int flags,
   ldp_init_check ();
 
   vlsh = ldp_fd_to_vlsh (fd);
-  if (vlsh != INVALID_SESSION_ID)
+  if (vlsh != VLS_INVALID_HANDLE)
     {
       size = ldp_vls_sendo (vlsh, buf, n, flags, addr, addr_len);
       if (size < 0)
@@ -1702,7 +1702,7 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 
   ldp_init_check ();
 
-  if (sh != INVALID_SESSION_ID)
+  if (sh != VLS_INVALID_HANDLE)
     {
       clib_warning ("LDP<%d>: LDP-TBD", getpid ());
       errno = ENOSYS;
@@ -1802,7 +1802,7 @@ recvmmsg (int fd, struct mmsghdr *vmessages,
 
   ldp_init_check ();
 
-  if (sh != INVALID_SESSION_ID)
+  if (sh != VLS_INVALID_HANDLE)
     {
       clib_warning ("LDP<%d>: LDP-TBD", getpid ());
       errno = ENOSYS;