comparison netio.c @ 1733:d529a52b2f7c coverity coverity

merge coverity from main
author Matt Johnston <matt@ucc.asn.au>
date Fri, 26 Jun 2020 21:07:34 +0800
parents 58f7ca8ebc82
children 97ad26e397a5
comparison
equal deleted inserted replaced
1643:b59623a64678 1733:d529a52b2f7c
291 struct Link *l; 291 struct Link *l;
292 unsigned int i; 292 unsigned int i;
293 int len; 293 int len;
294 buffer *writebuf; 294 buffer *writebuf;
295 295
296 #ifndef IOV_MAX 296 #ifndef IOV_MAX
297 #if defined(__CYGWIN__) && !defined(UIO_MAXIOV) 297 #if defined(__CYGWIN__) && !defined(UIO_MAXIOV)
298 #define IOV_MAX 1024 298 #define IOV_MAX 1024
299 #else 299 #elif defined(__sgi)
300 #define IOV_MAX 512
301 #else
300 #define IOV_MAX UIO_MAXIOV 302 #define IOV_MAX UIO_MAXIOV
301 #endif
302 #endif 303 #endif
304 #endif
303 305
304 *iov_count = MIN(MIN(queue->count, IOV_MAX), *iov_count); 306 *iov_count = MIN(MIN(queue->count, IOV_MAX), *iov_count);
305 307
306 for (l = queue->head, i = 0; i < *iov_count; l = l->link, i++) 308 for (l = queue->head, i = 0; i < *iov_count; l = l->link, i++)
307 { 309 {
396 } else if (prio == DROPBEAR_PRIO_BULK) { 398 } else if (prio == DROPBEAR_PRIO_BULK) {
397 so_prio_val = TC_PRIO_BULK; 399 so_prio_val = TC_PRIO_BULK;
398 } 400 }
399 /* linux specific, sets QoS class. see tc-prio(8) */ 401 /* linux specific, sets QoS class. see tc-prio(8) */
400 rc = setsockopt(sock, SOL_SOCKET, SO_PRIORITY, (void*) &so_prio_val, sizeof(so_prio_val)); 402 rc = setsockopt(sock, SOL_SOCKET, SO_PRIORITY, (void*) &so_prio_val, sizeof(so_prio_val));
401 if (rc < 0 && errno != ENOTSOCK) 403 if (rc < 0 && errno != ENOTSOCK) {
402 dropbear_log(LOG_WARNING, "Couldn't set SO_PRIORITY (%s)", 404 TRACE(("Couldn't set SO_PRIORITY (%s)", strerror(errno)))
403 strerror(errno)); 405 }
404 #endif 406 #endif
405 407
406 } 408 }
407 409
408 /* from openssh/canohost.c avoid premature-optimization */ 410 /* from openssh/canohost.c avoid premature-optimization */