git: a2a8efb4f6c1 - main - rtsold: Use correct error in llflags_get()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 25 Feb 2022 15:31:05 UTC
The branch main has been updated by vangyzen:
URL: https://cgit.FreeBSD.org/src/commit/?id=a2a8efb4f6c15ad0880167cb22452e50aaacf52f
commit a2a8efb4f6c15ad0880167cb22452e50aaacf52f
Author: Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2022-02-23 16:29:53 +0000
Commit: Eric van Gyzen <vangyzen@FreeBSD.org>
CommitDate: 2022-02-25 15:30:29 +0000
rtsold: Use correct error in llflags_get()
Set errno to EINVAL if the name overflows the buffer, as was done
before commit ecce515d54bc.
Reviewed by: dab, markj
Fixes: ecce515d54bcea54fea03f731aad646c87761d22
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D34354
---
usr.sbin/rtsold/cap_llflags.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/rtsold/cap_llflags.c b/usr.sbin/rtsold/cap_llflags.c
index 195f83893b4d..aea45d9fb8a0 100644
--- a/usr.sbin/rtsold/cap_llflags.c
+++ b/usr.sbin/rtsold/cap_llflags.c
@@ -91,7 +91,7 @@ llflags_get(const char *ifname, int *flagsp)
memset(&ifr6, 0, sizeof(ifr6));
if (strlcpy(ifr6.ifr_name, ifname, sizeof(ifr6.ifr_name)) >=
sizeof(ifr6.ifr_name)) {
- error = errno;
+ error = EINVAL;
goto out;
}
memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len);