1diff -Nur lwip-ipv6/src/core/ipv6/ip6.c lwip-ipv6-hdr/src/core/ipv6/ip6.c 2--- lwip-ipv6/src/core/ipv6/ip6.c 2023-11-15 19:48:02.864481010 +0800 3+++ lwip-ipv6-hdr/src/core/ipv6/ip6.c 2023-11-15 20:05:30.388481010 +0800 4@@ -367,7 +367,7 @@ 5 * @param inp the netif on which this packet was received 6 */ 7 static void 8-ip6_forward(struct pbuf *p, struct ip6_hdr *iphdr, struct netif *inp) 9+ip6_forward(struct pbuf *p, struct ip6hdr *iphdr, struct netif *inp) 10 { 11 struct netif *netif; 12 13@@ -512,7 +512,7 @@ 14 err_t 15 ip6_input(struct pbuf *p, struct netif *inp) 16 { 17- struct ip6_hdr *ip6hdr; 18+ struct ip6hdr *ip6hdr; 19 struct netif *netif; 20 const u8_t *nexth; 21 u16_t hlen, hlen_tot; /* the current header length */ 22@@ -531,7 +531,7 @@ 23 IP6_STATS_INC(ip6.recv); 24 25 /* identify the IP header */ 26- ip6hdr = (struct ip6_hdr *)p->payload; 27+ ip6hdr = (struct ip6hdr *)p->payload; 28 if (IP6H_V(ip6hdr) != 6) { 29 LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IPv6 packet dropped due to bad version number %"U32_F"\n", 30 IP6H_V(ip6hdr))); 31@@ -1015,7 +1015,7 @@ 32 33 /* Returned p point to IPv6 header. 34 * Update all our variables and pointers and continue. */ 35- ip6hdr = (struct ip6_hdr *)p->payload; 36+ ip6hdr = (struct ip6hdr *)p->payload; 37 nexth = &IP6H_NEXTH(ip6hdr); 38 hlen = hlen_tot = IP6_HLEN; 39 pbuf_remove_header(p, IP6_HLEN); 40@@ -1188,7 +1188,7 @@ 41 u8_t hl, u8_t tc, 42 u8_t nexth, struct netif *netif) 43 { 44- struct ip6_hdr *ip6hdr; 45+ struct ip6hdr *ip6hdr; 46 ip6_addr_t dest_addr; 47 48 LWIP_ASSERT_CORE_LOCKED(); 49@@ -1217,9 +1217,9 @@ 50 return ERR_BUF; 51 } 52 53- ip6hdr = (struct ip6_hdr *)p->payload; 54- LWIP_ASSERT("check that first pbuf can hold struct ip6_hdr", 55- (p->len >= sizeof(struct ip6_hdr))); 56+ ip6hdr = (struct ip6hdr *)p->payload; 57+ LWIP_ASSERT("check that first pbuf can hold struct ip6hdr", 58+ (p->len >= sizeof(struct ip6hdr))); 59 60 IP6H_HOPLIM_SET(ip6hdr, hl); 61 IP6H_NEXTH_SET(ip6hdr, nexth); 62@@ -1242,7 +1242,7 @@ 63 64 } else { 65 /* IP header already included in p */ 66- ip6hdr = (struct ip6_hdr *)p->payload; 67+ ip6hdr = (struct ip6hdr *)p->payload; 68 ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest); 69 ip6_addr_assign_zone(&dest_addr, IP6_UNKNOWN, netif); 70 dest = &dest_addr; 71@@ -1316,7 +1316,7 @@ 72 u8_t hl, u8_t tc, u8_t nexth) 73 { 74 struct netif *netif; 75- struct ip6_hdr *ip6hdr; 76+ struct ip6hdr *ip6hdr; 77 ip6_addr_t src_addr, dest_addr; 78 79 LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); 80@@ -1325,7 +1325,7 @@ 81 netif = ip6_route(src, dest); 82 } else { 83 /* IP header included in p, read addresses. */ 84- ip6hdr = (struct ip6_hdr *)p->payload; 85+ ip6hdr = (struct ip6hdr *)p->payload; 86 ip6_addr_copy_from_packed(src_addr, ip6hdr->src); 87 ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest); 88 netif = ip6_route(&src_addr, &dest_addr); 89@@ -1375,7 +1375,7 @@ 90 u8_t hl, u8_t tc, u8_t nexth, struct netif_hint *netif_hint) 91 { 92 struct netif *netif; 93- struct ip6_hdr *ip6hdr; 94+ struct ip6hdr *ip6hdr; 95 ip6_addr_t src_addr, dest_addr; 96 err_t err; 97 98@@ -1385,7 +1385,7 @@ 99 netif = ip6_route(src, dest); 100 } else { 101 /* IP header included in p, read addresses. */ 102- ip6hdr = (struct ip6_hdr *)p->payload; 103+ ip6hdr = (struct ip6hdr *)p->payload; 104 ip6_addr_copy_from_packed(src_addr, ip6hdr->src); 105 ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest); 106 netif = ip6_route(&src_addr, &dest_addr); 107@@ -1476,7 +1476,7 @@ 108 void 109 ip6_debug_print(struct pbuf *p) 110 { 111- struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload; 112+ struct ip6hdr *ip6hdr = (struct ip6hdr *)p->payload; 113 114 LWIP_DEBUGF(IP6_DEBUG, ("IPv6 header:\n")); 115 LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); 116diff -Nur lwip-ipv6/src/core/ipv6/ip6_frag.c lwip-ipv6-hdr/src/core/ipv6/ip6_frag.c 117--- lwip-ipv6/src/core/ipv6/ip6_frag.c 2023-11-15 19:48:02.864481010 +0800 118+++ lwip-ipv6-hdr/src/core/ipv6/ip6_frag.c 2023-11-15 20:01:41.668481010 +0800 119@@ -551,7 +551,7 @@ 120 121 if (valid) { 122 /* All fragments have been received */ 123- struct ip6_hdr* iphdr_ptr; 124+ struct ip6hdr* iphdr_ptr; 125 126 /* chain together the pbufs contained within the ip6_reassdata list. */ 127 iprh = (struct ip6_reass_helper*) ipr->p->payload; 128@@ -565,7 +565,7 @@ 129 pbuf_remove_header(next_pbuf, IP6_FRAG_HLEN); 130 #if IPV6_FRAG_COPYHEADER 131 if (IPV6_FRAG_REQROOM > 0) { 132- /* hide the extra bytes borrowed from ip6_hdr for struct ip6_reass_helper */ 133+ /* hide the extra bytes borrowed from ip6hdr for struct ip6_reass_helper */ 134 u8_t hdrerr = pbuf_remove_header(next_pbuf, IPV6_FRAG_REQROOM); 135 LWIP_UNUSED_ARG(hdrerr); /* in case of LWIP_NOASSERT */ 136 LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0); 137@@ -610,7 +610,7 @@ 138 (size_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr)); 139 140 /* This is where the IPv6 header is now. */ 141- iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->iphdr + 142+ iphdr_ptr = (struct ip6hdr*)((u8_t*)ipr->iphdr + 143 sizeof(struct ip6_frag_hdr)); 144 145 /* Adjust datagram length by adding header lengths. */ 146@@ -721,8 +721,8 @@ 147 err_t 148 ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest) 149 { 150- struct ip6_hdr *original_ip6hdr; 151- struct ip6_hdr *ip6hdr; 152+ struct ip6hdr *original_ip6hdr; 153+ struct ip6hdr *ip6hdr; 154 struct ip6_frag_hdr *frag_hdr; 155 struct pbuf *rambuf; 156 #if !LWIP_NETIF_TX_SINGLE_PBUF 157@@ -740,7 +740,7 @@ 158 159 identification++; 160 161- original_ip6hdr = (struct ip6_hdr *)p->payload; 162+ original_ip6hdr = (struct ip6hdr *)p->payload; 163 164 /* @todo we assume there are no options in the unfragmentable part (IPv6 header). */ 165 LWIP_ASSERT("p->tot_len >= IP6_HLEN", p->tot_len >= IP6_HLEN); 166@@ -769,7 +769,7 @@ 167 } 168 /* fill in the IP header */ 169 SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN); 170- ip6hdr = (struct ip6_hdr *)rambuf->payload; 171+ ip6hdr = (struct ip6hdr *)rambuf->payload; 172 frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN); 173 #else 174 /* When not using a static buffer, create a chain of pbufs. 175@@ -785,7 +785,7 @@ 176 LWIP_ASSERT("this needs a pbuf in one piece!", 177 (rambuf->len >= (IP6_HLEN))); 178 SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN); 179- ip6hdr = (struct ip6_hdr *)rambuf->payload; 180+ ip6hdr = (struct ip6hdr *)rambuf->payload; 181 frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN); 182 183 /* Can just adjust p directly for needed offset. */ 184diff -Nur lwip-ipv6/src/core/ipv6/nd6.c lwip-ipv6-hdr/src/core/ipv6/nd6.c 185--- lwip-ipv6/src/core/ipv6/nd6.c 2023-11-15 19:48:02.864481010 +0800 186+++ lwip-ipv6-hdr/src/core/ipv6/nd6.c 2023-11-15 20:06:47.036481010 +0800 187@@ -895,7 +895,7 @@ 188 case ICMP6_TYPE_PTB: /* Packet too big */ 189 { 190 struct icmp6_hdr *icmp6hdr; /* Packet too big message */ 191- struct ip6_hdr *ip6hdr; /* IPv6 header of the packet which caused the error */ 192+ struct ip6hdr *ip6hdr; /* IPv6 header of the packet which caused the error */ 193 u32_t pmtu; 194 ip6_addr_t destination_address; 195 196@@ -909,7 +909,7 @@ 197 } 198 199 icmp6hdr = (struct icmp6_hdr *)p->payload; 200- ip6hdr = (struct ip6_hdr *)((u8_t*)p->payload + sizeof(struct icmp6_hdr)); 201+ ip6hdr = (struct ip6hdr *)((u8_t*)p->payload + sizeof(struct icmp6_hdr)); 202 203 /* Create an aligned, zoned copy of the destination address. */ 204 ip6_addr_copy_from_packed(destination_address, ip6hdr->dest); 205@@ -2187,7 +2187,7 @@ 206 static void 207 nd6_send_q(s8_t i) 208 { 209- struct ip6_hdr *ip6hdr; 210+ struct ip6hdr *ip6hdr; 211 ip6_addr_t dest; 212 #if LWIP_ND6_QUEUEING 213 struct nd6_q_entry *q; 214@@ -2204,7 +2204,7 @@ 215 /* pop first item off the queue */ 216 neighbor_cache[i].q = q->next; 217 /* Get ipv6 header. */ 218- ip6hdr = (struct ip6_hdr *)(q->p->payload); 219+ ip6hdr = (struct ip6hdr *)(q->p->payload); 220 /* Create an aligned copy. */ 221 ip6_addr_copy_from_packed(dest, ip6hdr->dest); 222 /* Restore the zone, if applicable. */ 223@@ -2219,7 +2219,7 @@ 224 #else /* LWIP_ND6_QUEUEING */ 225 if (neighbor_cache[i].q != NULL) { 226 /* Get ipv6 header. */ 227- ip6hdr = (struct ip6_hdr *)(neighbor_cache[i].q->payload); 228+ ip6hdr = (struct ip6hdr *)(neighbor_cache[i].q->payload); 229 /* Create an aligned copy. */ 230 ip6_addr_copy_from_packed(dest, ip6hdr->dest); 231 /* Restore the zone, if applicable. */ 232diff -Nur lwip-ipv6/src/core/raw.c lwip-ipv6-hdr/src/core/raw.c 233--- lwip-ipv6/src/core/raw.c 2023-11-15 19:48:02.860481010 +0800 234+++ lwip-ipv6-hdr/src/core/raw.c 2023-11-15 19:49:53.468481010 +0800 235@@ -146,7 +146,7 @@ 236 if (IP_HDR_GET_VERSION(p->payload) == 6) 237 #endif /* LWIP_IPV4 */ 238 { 239- struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload; 240+ struct ip6hdr *ip6hdr = (struct ip6hdr *)p->payload; 241 proto = IP6H_NEXTH(ip6hdr); 242 } 243 #if LWIP_IPV4 244diff -Nur lwip-ipv6/src/include/lwip/ip6_frag.h lwip-ipv6-hdr/src/include/lwip/ip6_frag.h 245--- lwip-ipv6/src/include/lwip/ip6_frag.h 2023-11-15 19:48:02.864481010 +0800 246+++ lwip-ipv6-hdr/src/include/lwip/ip6_frag.h 2023-11-15 20:13:40.008481010 +0800 247@@ -90,7 +90,7 @@ 248 struct ip6_reassdata { 249 struct ip6_reassdata *next; 250 struct pbuf *p; 251- struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */ 252+ struct ip6hdr *iphdr; /* pointer to the first (original) IPv6 header */ 253 #if IPV6_FRAG_COPYHEADER 254 ip6_addr_p_t src; /* copy of the source address in the IP header */ 255 ip6_addr_p_t dest; /* copy of the destination address in the IP header */ 256diff -Nur lwip-ipv6/src/include/lwip/ip.h lwip-ipv6-hdr/src/include/lwip/ip.h 257--- lwip-ipv6/src/include/lwip/ip.h 2023-11-15 19:48:02.864481010 +0800 258+++ lwip-ipv6-hdr/src/include/lwip/ip.h 2023-11-15 20:12:42.796481010 +0800 259@@ -123,7 +123,7 @@ 260 #endif /* LWIP_IPV4 */ 261 #if LWIP_IPV6 262 /** Header of the input IPv6 packet currently being processed. */ 263- struct ip6_hdr *current_ip6_header; 264+ struct ip6hdr *current_ip6_header; 265 #endif /* LWIP_IPV6 */ 266 /** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */ 267 u16_t current_ip_header_tot_len; 268@@ -159,7 +159,7 @@ 269 /** Get the IPv6 header of the current packet. 270 * This function must only be called from a receive callback (udp_recv, 271 * raw_recv, tcp_accept). It will return NULL otherwise. */ 272-#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) 273+#define ip6_current_header() ((const struct ip6hdr*)(ip_data.current_ip6_header)) 274 /** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */ 275 #define ip_current_is_v6() (ip6_current_header() != NULL) 276 /** Source IPv6 address of current_header */ 277@@ -201,7 +201,7 @@ 278 /** Get the IPv6 header of the current packet. 279 * This function must only be called from a receive callback (udp_recv, 280 * raw_recv, tcp_accept). It will return NULL otherwise. */ 281-#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) 282+#define ip6_current_header() ((const struct ip6hdr*)(ip_data.current_ip6_header)) 283 /** Always returns TRUE when only supporting IPv6 only */ 284 #define ip_current_is_v6() 1 285 /** Get the transport layer protocol */ 286diff -Nur lwip-ipv6/src/include/lwip/prot/ip6.h lwip-ipv6-hdr/src/include/lwip/prot/ip6.h 287--- lwip-ipv6/src/include/lwip/prot/ip6.h 2023-11-15 19:48:02.868481010 +0800 288+++ lwip-ipv6-hdr/src/include/lwip/prot/ip6.h 2023-11-17 13:24:56.832481010 +0800 289@@ -79,7 +79,7 @@ 290 # include "arch/bpstruct.h" 291 #endif 292 PACK_STRUCT_BEGIN 293-struct ip6_hdr { 294+struct ip6hdr { 295 /** version / traffic class / flow label */ 296 PACK_STRUCT_FIELD(u32_t _v_tc_fl); 297 /** payload length */ 298diff -Nur lwip-ipv6/src/netif/lowpan6.c lwip-ipv6-hdr/src/netif/lowpan6.c 299--- lwip-ipv6/src/netif/lowpan6.c 2023-11-15 19:48:02.868481010 +0800 300+++ lwip-ipv6-hdr/src/netif/lowpan6.c 2023-11-15 20:16:23.836481010 +0800 301@@ -570,12 +570,12 @@ 302 struct lowpan6_link_addr src, dest; 303 #if LWIP_6LOWPAN_INFER_SHORT_ADDRESS 304 ip6_addr_t ip6_src; 305- struct ip6_hdr *ip6_hdr; 306+ struct ip6hdr *ip6_hdr; 307 #endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ 308 309 #if LWIP_6LOWPAN_INFER_SHORT_ADDRESS 310 /* Check if we can compress source address (use aligned copy) */ 311- ip6_hdr = (struct ip6_hdr *)q->payload; 312+ ip6_hdr = (struct ip6hdr *)q->payload; 313 ip6_addr_copy_from_packed(ip6_src, ip6_hdr->src); 314 ip6_addr_assign_zone(&ip6_src, IP6_UNICAST, netif); 315 if (lowpan6_get_address_mode(&ip6_src, &short_mac_addr) == 3) { 316diff -Nur lwip-ipv6/src/netif/lowpan6_common.c lwip-ipv6-hdr/src/netif/lowpan6_common.c 317--- lwip-ipv6/src/netif/lowpan6_common.c 2023-11-15 19:48:02.868481010 +0800 318+++ lwip-ipv6-hdr/src/netif/lowpan6_common.c 2023-11-15 20:15:44.460481010 +0800 319@@ -137,7 +137,7 @@ 320 u8_t lowpan6_header_len; 321 u8_t hidden_header_len = 0; 322 s8_t i; 323- struct ip6_hdr *ip6hdr; 324+ struct ip6hdr *ip6hdr; 325 ip_addr_t ip6src, ip6dst; 326 327 LWIP_ASSERT("netif != NULL", netif != NULL); 328@@ -160,7 +160,7 @@ 329 } 330 331 /* Point to ip6 header and align copies of src/dest addresses. */ 332- ip6hdr = (struct ip6_hdr *)inptr; 333+ ip6hdr = (struct ip6hdr *)inptr; 334 ip_addr_copy_from_ip6_packed(ip6dst, ip6hdr->dest); 335 ip6_addr_assign_zone(ip_2_ip6(&ip6dst), IP6_UNKNOWN, netif); 336 ip_addr_copy_from_ip6_packed(ip6src, ip6hdr->src); 337@@ -396,7 +396,7 @@ 338 struct lowpan6_link_addr *src, struct lowpan6_link_addr *dest) 339 { 340 u16_t lowpan6_offset; 341- struct ip6_hdr *ip6hdr; 342+ struct ip6hdr *ip6hdr; 343 s8_t i; 344 u32_t header_temp; 345 u16_t ip6_offset = IP6_HLEN; 346@@ -408,7 +408,7 @@ 347 LWIP_ASSERT("hdr_size_comp != NULL", hdr_size_comp != NULL); 348 LWIP_ASSERT("dehdr_size_decompst != NULL", hdr_size_decomp != NULL); 349 350- ip6hdr = (struct ip6_hdr *)decomp_buffer; 351+ ip6hdr = (struct ip6hdr *)decomp_buffer; 352 if (decomp_bufsize < IP6_HLEN) { 353 return ERR_MEM; 354 } 355