git: 1408670c90ae - main - in6_control_ioctl: correctly report errors from SIOCAIFADDR_IN6

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Mon, 07 Apr 2025 22:11:51 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=1408670c90ae38fd51ea6aaabe46757bc880608e

commit 1408670c90ae38fd51ea6aaabe46757bc880608e
Author:     Lexi Winter <lexi@hemlock.eden.le-fay.org>
AuthorDate: 2025-04-07 12:40:07 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-04-07 20:46:03 +0000

    in6_control_ioctl: correctly report errors from SIOCAIFADDR_IN6
    
    we have to use 'goto out' here rather than 'break' because otherwise
    error is set to 0, which means the error is not propagated back to the
    caller.
    
    Reviewed by:    kp
---
 sys/netinet6/in6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index ffbe64f4de80..00a0b40154d2 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -587,7 +587,7 @@ in6_control_ioctl(u_long cmd, void *data,
 #endif
 		error = in6_addifaddr(ifp, ifra, ia);
 		ia = NULL;
-		break;
+		goto out;
 
 	case SIOCDIFADDR_IN6:
 		in6_purgeifaddr(ia);