Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/dhcpcd/dist/src dhcpcd: Fix non INET6 builds.
details: https://anonhg.NetBSD.org/src/rev/bf063cbf51ba
branches: trunk
changeset: 374486:bf063cbf51ba
user: roy <roy%NetBSD.org@localhost>
date: Thu Apr 27 13:21:59 2023 +0000
description:
dhcpcd: Fix non INET6 builds.
Thanks to J. Hannken-Illjes for the fix.
diffstat:
external/bsd/dhcpcd/dist/src/if-bsd.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (34 lines):
diff -r fd288f936991 -r bf063cbf51ba external/bsd/dhcpcd/dist/src/if-bsd.c
--- a/external/bsd/dhcpcd/dist/src/if-bsd.c Thu Apr 27 06:30:09 2023 +0000
+++ b/external/bsd/dhcpcd/dist/src/if-bsd.c Thu Apr 27 13:21:59 2023 +0000
@@ -167,15 +167,13 @@ if_opensockets_os(struct dhcpcd_ctx *ctx
#ifdef INET6
priv->pf_inet6_fd = xsocket(PF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0);
-#ifdef PRIVSEP_RIGHTS
- if (IN_PRIVSEP(ctx))
- ps_rights_limit_ioctl(priv->pf_inet6_fd);
-#endif
/* Don't return an error so we at least work on kernels witout INET6
* even though we expect INET6 support.
* We will fail noisily elsewhere anyway. */
-#else
- priv->pf_inet6_fd = -1;
+#ifdef PRIVSEP_RIGHTS
+ if (priv->pf_inet6_fd != -1 && IN_PRIVSEP(ctx))
+ ps_rights_limit_ioctl(priv->pf_inet6_fd);
+#endif
#endif
ctx->link_fd = xsocket(PF_ROUTE, SOCK_RAW | SOCK_CXNB, AF_UNSPEC);
@@ -234,8 +232,10 @@ if_closesockets_os(struct dhcpcd_ctx *ct
struct priv *priv;
priv = (struct priv *)ctx->priv;
+#ifdef INET6
if (priv->pf_inet6_fd != -1)
close(priv->pf_inet6_fd);
+#endif
#if defined(SIOCALIFADDR) && defined(IFLR_ACTIVE) /*NetBSD */
if (priv->pf_link_fd != -1)
close(priv->pf_link_fd);
Home |
Main Index |
Thread Index |
Old Index