summaryrefslogtreecommitdiff
path: root/net-misc/dhcpcd/files/dhcpcd-10.2.0-no-ipv6-build.patch
blob: c9f426d913c0f981cde41a152b6a0867dd46761d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 <roy@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