git: b43916e2300a - stable/13 - rtsold: Use correct error in llflags_get()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 02 Mar 2022 21:57:31 UTC
The branch stable/13 has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=b43916e2300af65350d874481d15521a0458ef6a commit b43916e2300af65350d874481d15521a0458ef6a Author: Eric van Gyzen <vangyzen@FreeBSD.org> AuthorDate: 2022-02-23 16:29:53 +0000 Commit: Eric van Gyzen <vangyzen@FreeBSD.org> CommitDate: 2022-03-02 21:56:31 +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 (cherry picked from commit a2a8efb4f6c15ad0880167cb22452e50aaacf52f) --- 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);