commit:     15311ec67778da347c0f4803ab936f91a72a2152
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 13 07:46:25 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb 13 07:46:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15311ec6

net-misc/dhcpcd: fix build w/ USE=-ipv6

Closes: https://bugs.gentoo.org/949688
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/dhcpcd/dhcpcd-10.2.0.ebuild               |   1 +
 .../dhcpcd/files/dhcpcd-10.2.0-no-ipv6-build.patch | 110 +++++++++++++++++++++
 2 files changed, 111 insertions(+)

diff --git a/net-misc/dhcpcd/dhcpcd-10.2.0.ebuild 
b/net-misc/dhcpcd/dhcpcd-10.2.0.ebuild
index fcfca62700dc..c3595a4f780e 100644
--- a/net-misc/dhcpcd/dhcpcd-10.2.0.ebuild
+++ b/net-misc/dhcpcd/dhcpcd-10.2.0.ebuild
@@ -54,6 +54,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 
 PATCHES=(
        "${FILESDIR}"/${PN}-10.0.6-fix-lib-check.patch
+       "${FILESDIR}"/${P}-no-ipv6-build.patch
 )
 
 src_configure() {

diff --git a/net-misc/dhcpcd/files/dhcpcd-10.2.0-no-ipv6-build.patch 
b/net-misc/dhcpcd/files/dhcpcd-10.2.0-no-ipv6-build.patch
new file mode 100644
index 000000000000..c9f426d913c0
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-10.2.0-no-ipv6-build.patch
@@ -0,0 +1,110 @@
+https://bugs.gentoo.org/949688
+https://github.com/NetworkConfiguration/dhcpcd/commit/7f70a6a4e6e19703e705881da958e8a1d42d27ec
+
+From 7f70a6a4e6e19703e705881da958e8a1d42d27ec Mon Sep 17 00:00:00 2001
+From: Roy Marples <r...@marples.name>
+Date: Thu, 13 Feb 2025 00:32:43 +0000
+Subject: [PATCH] Address some build options
+
+Fixes #458.
+--- a/src/dhcp.c
++++ b/src/dhcp.c
+@@ -3068,7 +3068,7 @@ dhcp_handledhcp(struct interface *ifp, struct bootp 
*bootp, size_t bootp_len,
+       struct dhcp_state *state = D_STATE(ifp);
+       struct if_options *ifo = ifp->options;
+       struct dhcp_lease *lease = &state->lease;
+-      uint8_t type, tmp;
++      uint8_t type;
+       struct in_addr addr;
+       unsigned int i;
+       char *msg;
+@@ -3079,6 +3079,9 @@ dhcp_handledhcp(struct interface *ifp, struct bootp 
*bootp, size_t bootp_len,
+       const uint8_t *auth;
+       size_t auth_len;
+ #endif
++#ifdef IPV4LL
++      uint8_t tmp;
++#endif
+ #ifdef IN_IFF_DUPLICATED
+       struct ipv4_addr *ia;
+ #endif
+--- a/src/if-options.c
++++ b/src/if-options.c
+@@ -655,8 +655,6 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, 
struct if_options *ifo,
+       uint8_t *request, *require, *no, *reject;
+       struct dhcp_opt **dop, *ndop;
+       size_t *dop_len, dl, odl;
+-      struct vivco *vivco;
+-      const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len;
+       struct group *grp;
+ #ifdef AUTH
+       struct token *token;
+@@ -665,16 +663,22 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, 
struct if_options *ifo,
+       struct group grpbuf;
+ #endif
+ #ifdef DHCP6
+-      size_t sl;
+       struct if_ia *ia;
+       uint8_t iaid[4];
++#endif
++#if defined(DHCP6) || ((defined(INET) || defined(INET6)) && !defined(SMALL))
++      size_t sl;
++#endif
+ #ifndef SMALL
+-      struct in6_addr in6addr;
++#ifdef DHCP6
+       struct if_sla *sla, *slap;
++#endif
++      struct vivco *vivco;
++      const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len;
++      struct in6_addr in6addr;
+       struct vsio **vsiop = NULL, *vsio;
+       size_t *vsio_lenp = NULL, opt_max, opt_header;
+       struct vsio_so *vsio_so;
+-#endif
+ #endif
+ 
+       dop = NULL;
+@@ -2951,11 +2955,11 @@ free_options(struct dhcpcd_ctx *ctx, struct if_options 
*ifo)
+       struct rt *rt;
+ #endif
+       struct dhcp_opt *opt;
+-      struct vivco *vo;
+ #ifdef AUTH
+       struct token *token;
+ #endif
+ #ifndef SMALL
++      struct vivco *vo;
+       struct vsio *vsio;
+       struct vsio_so *vsio_so;
+ #endif
+--- a/src/ipv6.c
++++ b/src/ipv6.c
+@@ -626,7 +626,7 @@ ipv6_deletedaddr(struct ipv6_addr *ia)
+ #endif
+ 
+ #if !defined(DHCP6) || (!defined(PRIVSEP) && defined(SMALL))
+-      UNUSED(ia)
++      UNUSED(ia);
+ #endif
+ }
+ 
+--- a/src/privsep-inet.c
++++ b/src/privsep-inet.c
+@@ -215,6 +215,7 @@ ps_inet_startcb(struct ps_process *psp)
+       return ret;
+ }
+ 
++#if defined(INET) || defined(DHCP6)
+ static bool
+ ps_inet_validudp(struct msghdr *msg, uint16_t sport, uint16_t dport)
+ {
+@@ -233,6 +234,7 @@ ps_inet_validudp(struct msghdr *msg, uint16_t sport, 
uint16_t dport)
+       }
+       return true;
+ }
++#endif
+ 
+ #ifdef INET6
+ static bool
+

Reply via email to