remove-ctassert.patch (3325B)
- # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
- #
- # SPDX-License-Identifier: BSD-2-Clause
- __CTASSERT macro does not work properly on our older GCC.
- diff -ru src/arp.c src/arp.c
- --- dhcpcd-10.0.1/src/arp.c
- +++ dhcpcd-10.0.1/src/arp.c
- @@ -63,9 +63,6 @@
- /* ARP debugging can be quite noisy. Enable this for more noise! */
- //#define ARP_DEBUG
- -/* Assert the correct structure size for on wire */
- -__CTASSERT(sizeof(struct arphdr) == 8);
- -
- static ssize_t
- arp_request(const struct arp_state *astate,
- const struct in_addr *sip)
- diff -ru src/auth.c src/auth.c
- --- dhcpcd-10.0.1/src/auth.c
- +++ dhcpcd-10.0.1/src/auth.c
- @@ -343,9 +343,6 @@
- /* RFC3318, section 5.2 - zero giaddr and hops */
- if (mp == 4) {
- - /* Assert the bootp structure is correct size. */
- - __CTASSERT(sizeof(struct bootp) == 300);
- -
- *(mm + offsetof(struct bootp, hops)) = '\0';
- memset(mm + offsetof(struct bootp, giaddr), 0, 4);
- }
- diff -ru src/dhcp6.c src/dhcp6.c
- --- dhcpcd-10.0.1/src/dhcp6.c
- +++ dhcpcd-10.0.1/src/dhcp6.c
- @@ -84,33 +84,28 @@
- uint8_t xid[3];
- /* followed by options */
- };
- -__CTASSERT(sizeof(struct dhcp6_message) == 4);
- struct dhcp6_option {
- uint16_t code;
- uint16_t len;
- /* followed by data */
- };
- -__CTASSERT(sizeof(struct dhcp6_option) == 4);
- struct dhcp6_ia_na {
- uint8_t iaid[4];
- uint32_t t1;
- uint32_t t2;
- };
- -__CTASSERT(sizeof(struct dhcp6_ia_na) == 12);
- struct dhcp6_ia_ta {
- uint8_t iaid[4];
- };
- -__CTASSERT(sizeof(struct dhcp6_ia_ta) == 4);
- struct dhcp6_ia_addr {
- struct in6_addr addr;
- uint32_t pltime;
- uint32_t vltime;
- };
- -__CTASSERT(sizeof(struct dhcp6_ia_addr) == 16 + 8);
- /* XXX FIXME: This is the only packed structure and it does not align.
- * Maybe manually decode it? */
- @@ -120,7 +115,6 @@
- uint8_t prefix_len;
- struct in6_addr prefix;
- } __packed;
- -__CTASSERT(sizeof(struct dhcp6_pd_addr) == 8 + 1 + 16);
- struct dhcp6_op {
- uint16_t type;
- diff -ru src/dhcp.c src/dhcp.c
- --- dhcpcd-10.0.1/src/dhcp.c
- +++ dhcpcd-10.0.1/src/dhcp.c
- @@ -98,11 +98,6 @@
- #define IP_RECVPKTINFO IP_PKTINFO
- #endif
- -/* Assert the correct structure size for on wire */
- -__CTASSERT(sizeof(struct ip) == 20);
- -__CTASSERT(sizeof(struct udphdr) == 8);
- -__CTASSERT(sizeof(struct bootp) == 300);
- -
- struct dhcp_op {
- uint8_t value;
- const char *name;
- diff -ru src/if-bsd.c src/if-bsd.c
- --- dhcpcd-10.0.1/src/if-bsd.c
- +++ dhcpcd-10.0.1/src/if-bsd.c
- @@ -1600,7 +1600,6 @@
- #endif
- }
- -__CTASSERT(offsetof(struct rt_msghdr, rtm_msglen) == 0);
- int
- if_handlelink(struct dhcpcd_ctx *ctx)
- {
- diff -ru src/ipv6nd.c src/ipv6nd.c
- --- dhcpcd-10.0.1/src/ipv6nd.c
- +++ dhcpcd-10.0.1/src/ipv6nd.c
- @@ -80,7 +80,6 @@
- uint32_t nd_opt_rdnss_lifetime;
- /* followed by list of IP prefixes */
- };
- -__CTASSERT(sizeof(struct nd_opt_rdnss) == 8);
- #endif
- #ifndef ND_OPT_DNSSL
- @@ -92,7 +91,6 @@
- uint32_t nd_opt_dnssl_lifetime;
- /* followed by list of DNS servers */
- };
- -__CTASSERT(sizeof(struct nd_opt_dnssl) == 8);
- #endif
- /* Impossible options, so we can easily add extras */
- diff -ru src/privsep-root.c src/privsep-root.c
- --- dhcpcd-10.0.1/src/privsep-root.c
- +++ dhcpcd-10.0.1/src/privsep-root.c
- @@ -56,8 +56,6 @@
- #include "sa.h"
- #include "script.h"
- -__CTASSERT(sizeof(ioctl_request_t) <= sizeof(unsigned long));
- -
- struct psr_error
- {
- ssize_t psr_result;