git: 63f28490237f - main - ng_ksocket: fix build without INET6

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Mon, 13 Jan 2025 21:28:56 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=63f28490237fd8a8646c897e93b82e1ee0962502

commit 63f28490237fd8a8646c897e93b82e1ee0962502
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-01-13 21:27:32 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-01-13 21:27:32 +0000

    ng_ksocket: fix build without INET6
    
    Fixes:  9234a50752cd47887849d4665af0f9f4abdefb5d
---
 sys/netgraph/ng_ksocket.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index 43a2747224f3..74b2e211c0ed 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -44,6 +44,8 @@
  * version of a socket... kindof like the reverse of the socket node type.
  */
 
+#include "opt_inet6.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -313,7 +315,7 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type,
 		sin->sin_len = sizeof(*sin);
 		break;
 	    }
-
+#ifdef INET6
 	case PF_INET6:
 	    {
 		struct sockaddr_in6 *const sin6 = (struct sockaddr_in6 *)sa;
@@ -366,7 +368,7 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type,
 		sin6->sin6_len = sizeof(*sin6);
 		break;
 	    }
-
+#endif	/* INET6 */
 	default:
 		return (EINVAL);
 	}
@@ -424,7 +426,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type,
 		*off += sizeof(*sin);
 		return(0);
 	    }
-
+#ifdef INET6
 	case PF_INET6:
 	    {
 		const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa;
@@ -443,7 +445,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type,
 		*off += sizeof(*sin6);
 		return(0);
 	    }
-
+#endif	/* INET6 */
 	default:
 		return (*ng_ksocket_generic_sockaddr_type.supertype->unparse)
 		    (&ng_ksocket_generic_sockaddr_type,