logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

remove-ctassert.patch (3325B)


  1. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  2. #
  3. # SPDX-License-Identifier: BSD-2-Clause
  4. __CTASSERT macro does not work properly on our older GCC.
  5. diff -ru src/arp.c src/arp.c
  6. --- dhcpcd-10.0.1/src/arp.c
  7. +++ dhcpcd-10.0.1/src/arp.c
  8. @@ -63,9 +63,6 @@
  9. /* ARP debugging can be quite noisy. Enable this for more noise! */
  10. //#define ARP_DEBUG
  11. -/* Assert the correct structure size for on wire */
  12. -__CTASSERT(sizeof(struct arphdr) == 8);
  13. -
  14. static ssize_t
  15. arp_request(const struct arp_state *astate,
  16. const struct in_addr *sip)
  17. diff -ru src/auth.c src/auth.c
  18. --- dhcpcd-10.0.1/src/auth.c
  19. +++ dhcpcd-10.0.1/src/auth.c
  20. @@ -343,9 +343,6 @@
  21. /* RFC3318, section 5.2 - zero giaddr and hops */
  22. if (mp == 4) {
  23. - /* Assert the bootp structure is correct size. */
  24. - __CTASSERT(sizeof(struct bootp) == 300);
  25. -
  26. *(mm + offsetof(struct bootp, hops)) = '\0';
  27. memset(mm + offsetof(struct bootp, giaddr), 0, 4);
  28. }
  29. diff -ru src/dhcp6.c src/dhcp6.c
  30. --- dhcpcd-10.0.1/src/dhcp6.c
  31. +++ dhcpcd-10.0.1/src/dhcp6.c
  32. @@ -84,33 +84,28 @@
  33. uint8_t xid[3];
  34. /* followed by options */
  35. };
  36. -__CTASSERT(sizeof(struct dhcp6_message) == 4);
  37. struct dhcp6_option {
  38. uint16_t code;
  39. uint16_t len;
  40. /* followed by data */
  41. };
  42. -__CTASSERT(sizeof(struct dhcp6_option) == 4);
  43. struct dhcp6_ia_na {
  44. uint8_t iaid[4];
  45. uint32_t t1;
  46. uint32_t t2;
  47. };
  48. -__CTASSERT(sizeof(struct dhcp6_ia_na) == 12);
  49. struct dhcp6_ia_ta {
  50. uint8_t iaid[4];
  51. };
  52. -__CTASSERT(sizeof(struct dhcp6_ia_ta) == 4);
  53. struct dhcp6_ia_addr {
  54. struct in6_addr addr;
  55. uint32_t pltime;
  56. uint32_t vltime;
  57. };
  58. -__CTASSERT(sizeof(struct dhcp6_ia_addr) == 16 + 8);
  59. /* XXX FIXME: This is the only packed structure and it does not align.
  60. * Maybe manually decode it? */
  61. @@ -120,7 +115,6 @@
  62. uint8_t prefix_len;
  63. struct in6_addr prefix;
  64. } __packed;
  65. -__CTASSERT(sizeof(struct dhcp6_pd_addr) == 8 + 1 + 16);
  66. struct dhcp6_op {
  67. uint16_t type;
  68. diff -ru src/dhcp.c src/dhcp.c
  69. --- dhcpcd-10.0.1/src/dhcp.c
  70. +++ dhcpcd-10.0.1/src/dhcp.c
  71. @@ -98,11 +98,6 @@
  72. #define IP_RECVPKTINFO IP_PKTINFO
  73. #endif
  74. -/* Assert the correct structure size for on wire */
  75. -__CTASSERT(sizeof(struct ip) == 20);
  76. -__CTASSERT(sizeof(struct udphdr) == 8);
  77. -__CTASSERT(sizeof(struct bootp) == 300);
  78. -
  79. struct dhcp_op {
  80. uint8_t value;
  81. const char *name;
  82. diff -ru src/if-bsd.c src/if-bsd.c
  83. --- dhcpcd-10.0.1/src/if-bsd.c
  84. +++ dhcpcd-10.0.1/src/if-bsd.c
  85. @@ -1600,7 +1600,6 @@
  86. #endif
  87. }
  88. -__CTASSERT(offsetof(struct rt_msghdr, rtm_msglen) == 0);
  89. int
  90. if_handlelink(struct dhcpcd_ctx *ctx)
  91. {
  92. diff -ru src/ipv6nd.c src/ipv6nd.c
  93. --- dhcpcd-10.0.1/src/ipv6nd.c
  94. +++ dhcpcd-10.0.1/src/ipv6nd.c
  95. @@ -80,7 +80,6 @@
  96. uint32_t nd_opt_rdnss_lifetime;
  97. /* followed by list of IP prefixes */
  98. };
  99. -__CTASSERT(sizeof(struct nd_opt_rdnss) == 8);
  100. #endif
  101. #ifndef ND_OPT_DNSSL
  102. @@ -92,7 +91,6 @@
  103. uint32_t nd_opt_dnssl_lifetime;
  104. /* followed by list of DNS servers */
  105. };
  106. -__CTASSERT(sizeof(struct nd_opt_dnssl) == 8);
  107. #endif
  108. /* Impossible options, so we can easily add extras */
  109. diff -ru src/privsep-root.c src/privsep-root.c
  110. --- dhcpcd-10.0.1/src/privsep-root.c
  111. +++ dhcpcd-10.0.1/src/privsep-root.c
  112. @@ -56,8 +56,6 @@
  113. #include "sa.h"
  114. #include "script.h"
  115. -__CTASSERT(sizeof(ioctl_request_t) <= sizeof(unsigned long));
  116. -
  117. struct psr_error
  118. {
  119. ssize_t psr_result;