Change error code to ENOBUFS on lack of buffer memory

pointed out by k-goda@IIJ
This commit is contained in:
yamaguchi 2022-03-31 01:53:22 +00:00
parent ba9dc8b030
commit a5a34c682e
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $ */
/* $NetBSD: lagg.c,v 1.3 2022/03/31 01:53:22 yamaguchi Exp $ */
/*
* Copyright (c) 2021 Internet Initiative Japan Inc.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: lagg.c,v 1.2 2021/06/21 03:14:40 christos Exp $");
__RCSID("$NetBSD: lagg.c,v 1.3 2022/03/31 01:53:22 yamaguchi Exp $");
#endif /* !defined(lint) */
#include <sys/param.h>
@ -269,7 +269,7 @@ getlagg(prop_dictionary_t env)
if (indirect_ioctl(env, SIOCGLAGG, req) == 0)
goto done;
if (errno != ENOMEM)
if (errno != ENOBUFS)
break;
nports = req->lrq_nports + 3; /* 3: additional space */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_lagg.c,v 1.35 2022/03/31 01:49:02 yamaguchi Exp $ */
/* $NetBSD: if_lagg.c,v 1.36 2022/03/31 01:53:22 yamaguchi Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@ -20,7 +20,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.35 2022/03/31 01:49:02 yamaguchi Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.36 2022/03/31 01:53:22 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -2652,7 +2652,7 @@ lagg_get_stats(struct lagg_softc *sc, struct lagg_req *resp,
curlwp_bindx(bound);
if (resp->lrq_nports > nports) {
return ENOMEM;
return ENOBUFS;
}
return 0;
}