1195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/core/ipv6/ip6.c lwip-ipv6-hdr/src/core/ipv6/ip6.c
2195972f6Sopenharmony_ci--- lwip-ipv6/src/core/ipv6/ip6.c	2023-11-15 19:48:02.864481010 +0800
3195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/core/ipv6/ip6.c	2023-11-15 20:05:30.388481010 +0800
4195972f6Sopenharmony_ci@@ -367,7 +367,7 @@
5195972f6Sopenharmony_ci  * @param inp the netif on which this packet was received
6195972f6Sopenharmony_ci  */
7195972f6Sopenharmony_ci static void
8195972f6Sopenharmony_ci-ip6_forward(struct pbuf *p, struct ip6_hdr *iphdr, struct netif *inp)
9195972f6Sopenharmony_ci+ip6_forward(struct pbuf *p, struct ip6hdr *iphdr, struct netif *inp)
10195972f6Sopenharmony_ci {
11195972f6Sopenharmony_ci   struct netif *netif;
12195972f6Sopenharmony_ci 
13195972f6Sopenharmony_ci@@ -512,7 +512,7 @@
14195972f6Sopenharmony_ci err_t
15195972f6Sopenharmony_ci ip6_input(struct pbuf *p, struct netif *inp)
16195972f6Sopenharmony_ci {
17195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
18195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
19195972f6Sopenharmony_ci   struct netif *netif;
20195972f6Sopenharmony_ci   const u8_t *nexth;
21195972f6Sopenharmony_ci   u16_t hlen, hlen_tot; /* the current header length */
22195972f6Sopenharmony_ci@@ -531,7 +531,7 @@
23195972f6Sopenharmony_ci   IP6_STATS_INC(ip6.recv);
24195972f6Sopenharmony_ci 
25195972f6Sopenharmony_ci   /* identify the IP header */
26195972f6Sopenharmony_ci-  ip6hdr = (struct ip6_hdr *)p->payload;
27195972f6Sopenharmony_ci+  ip6hdr = (struct ip6hdr *)p->payload;
28195972f6Sopenharmony_ci   if (IP6H_V(ip6hdr) != 6) {
29195972f6Sopenharmony_ci     LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IPv6 packet dropped due to bad version number %"U32_F"\n",
30195972f6Sopenharmony_ci         IP6H_V(ip6hdr)));
31195972f6Sopenharmony_ci@@ -1015,7 +1015,7 @@
32195972f6Sopenharmony_ci 
33195972f6Sopenharmony_ci         /* Returned p point to IPv6 header.
34195972f6Sopenharmony_ci          * Update all our variables and pointers and continue. */
35195972f6Sopenharmony_ci-        ip6hdr = (struct ip6_hdr *)p->payload;
36195972f6Sopenharmony_ci+        ip6hdr = (struct ip6hdr *)p->payload;
37195972f6Sopenharmony_ci         nexth = &IP6H_NEXTH(ip6hdr);
38195972f6Sopenharmony_ci         hlen = hlen_tot = IP6_HLEN;
39195972f6Sopenharmony_ci         pbuf_remove_header(p, IP6_HLEN);
40195972f6Sopenharmony_ci@@ -1188,7 +1188,7 @@
41195972f6Sopenharmony_ci              u8_t hl, u8_t tc,
42195972f6Sopenharmony_ci              u8_t nexth, struct netif *netif)
43195972f6Sopenharmony_ci {
44195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
45195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
46195972f6Sopenharmony_ci   ip6_addr_t dest_addr;
47195972f6Sopenharmony_ci 
48195972f6Sopenharmony_ci   LWIP_ASSERT_CORE_LOCKED();
49195972f6Sopenharmony_ci@@ -1217,9 +1217,9 @@
50195972f6Sopenharmony_ci       return ERR_BUF;
51195972f6Sopenharmony_ci     }
52195972f6Sopenharmony_ci 
53195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)p->payload;
54195972f6Sopenharmony_ci-    LWIP_ASSERT("check that first pbuf can hold struct ip6_hdr",
55195972f6Sopenharmony_ci-               (p->len >= sizeof(struct ip6_hdr)));
56195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)p->payload;
57195972f6Sopenharmony_ci+    LWIP_ASSERT("check that first pbuf can hold struct ip6hdr",
58195972f6Sopenharmony_ci+               (p->len >= sizeof(struct ip6hdr)));
59195972f6Sopenharmony_ci 
60195972f6Sopenharmony_ci     IP6H_HOPLIM_SET(ip6hdr, hl);
61195972f6Sopenharmony_ci     IP6H_NEXTH_SET(ip6hdr, nexth);
62195972f6Sopenharmony_ci@@ -1242,7 +1242,7 @@
63195972f6Sopenharmony_ci 
64195972f6Sopenharmony_ci   } else {
65195972f6Sopenharmony_ci     /* IP header already included in p */
66195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)p->payload;
67195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)p->payload;
68195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest);
69195972f6Sopenharmony_ci     ip6_addr_assign_zone(&dest_addr, IP6_UNKNOWN, netif);
70195972f6Sopenharmony_ci     dest = &dest_addr;
71195972f6Sopenharmony_ci@@ -1316,7 +1316,7 @@
72195972f6Sopenharmony_ci           u8_t hl, u8_t tc, u8_t nexth)
73195972f6Sopenharmony_ci {
74195972f6Sopenharmony_ci   struct netif *netif;
75195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
76195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
77195972f6Sopenharmony_ci   ip6_addr_t src_addr, dest_addr;
78195972f6Sopenharmony_ci 
79195972f6Sopenharmony_ci   LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p);
80195972f6Sopenharmony_ci@@ -1325,7 +1325,7 @@
81195972f6Sopenharmony_ci     netif = ip6_route(src, dest);
82195972f6Sopenharmony_ci   } else {
83195972f6Sopenharmony_ci     /* IP header included in p, read addresses. */
84195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)p->payload;
85195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)p->payload;
86195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(src_addr, ip6hdr->src);
87195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest);
88195972f6Sopenharmony_ci     netif = ip6_route(&src_addr, &dest_addr);
89195972f6Sopenharmony_ci@@ -1375,7 +1375,7 @@
90195972f6Sopenharmony_ci           u8_t hl, u8_t tc, u8_t nexth, struct netif_hint *netif_hint)
91195972f6Sopenharmony_ci {
92195972f6Sopenharmony_ci   struct netif *netif;
93195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
94195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
95195972f6Sopenharmony_ci   ip6_addr_t src_addr, dest_addr;
96195972f6Sopenharmony_ci   err_t err;
97195972f6Sopenharmony_ci 
98195972f6Sopenharmony_ci@@ -1385,7 +1385,7 @@
99195972f6Sopenharmony_ci     netif = ip6_route(src, dest);
100195972f6Sopenharmony_ci   } else {
101195972f6Sopenharmony_ci     /* IP header included in p, read addresses. */
102195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)p->payload;
103195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)p->payload;
104195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(src_addr, ip6hdr->src);
105195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest);
106195972f6Sopenharmony_ci     netif = ip6_route(&src_addr, &dest_addr);
107195972f6Sopenharmony_ci@@ -1476,7 +1476,7 @@
108195972f6Sopenharmony_ci void
109195972f6Sopenharmony_ci ip6_debug_print(struct pbuf *p)
110195972f6Sopenharmony_ci {
111195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload;
112195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr = (struct ip6hdr *)p->payload;
113195972f6Sopenharmony_ci 
114195972f6Sopenharmony_ci   LWIP_DEBUGF(IP6_DEBUG, ("IPv6 header:\n"));
115195972f6Sopenharmony_ci   LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n"));
116195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/core/ipv6/ip6_frag.c lwip-ipv6-hdr/src/core/ipv6/ip6_frag.c
117195972f6Sopenharmony_ci--- lwip-ipv6/src/core/ipv6/ip6_frag.c	2023-11-15 19:48:02.864481010 +0800
118195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/core/ipv6/ip6_frag.c	2023-11-15 20:01:41.668481010 +0800
119195972f6Sopenharmony_ci@@ -551,7 +551,7 @@
120195972f6Sopenharmony_ci 
121195972f6Sopenharmony_ci   if (valid) {
122195972f6Sopenharmony_ci     /* All fragments have been received */
123195972f6Sopenharmony_ci-    struct ip6_hdr* iphdr_ptr;
124195972f6Sopenharmony_ci+    struct ip6hdr* iphdr_ptr;
125195972f6Sopenharmony_ci 
126195972f6Sopenharmony_ci     /* chain together the pbufs contained within the ip6_reassdata list. */
127195972f6Sopenharmony_ci     iprh = (struct ip6_reass_helper*) ipr->p->payload;
128195972f6Sopenharmony_ci@@ -565,7 +565,7 @@
129195972f6Sopenharmony_ci         pbuf_remove_header(next_pbuf, IP6_FRAG_HLEN);
130195972f6Sopenharmony_ci #if IPV6_FRAG_COPYHEADER
131195972f6Sopenharmony_ci         if (IPV6_FRAG_REQROOM > 0) {
132195972f6Sopenharmony_ci-          /* hide the extra bytes borrowed from ip6_hdr for struct ip6_reass_helper */
133195972f6Sopenharmony_ci+          /* hide the extra bytes borrowed from ip6hdr for struct ip6_reass_helper */
134195972f6Sopenharmony_ci           u8_t hdrerr = pbuf_remove_header(next_pbuf, IPV6_FRAG_REQROOM);
135195972f6Sopenharmony_ci           LWIP_UNUSED_ARG(hdrerr); /* in case of LWIP_NOASSERT */
136195972f6Sopenharmony_ci           LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0);
137195972f6Sopenharmony_ci@@ -610,7 +610,7 @@
138195972f6Sopenharmony_ci       (size_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr));
139195972f6Sopenharmony_ci 
140195972f6Sopenharmony_ci     /* This is where the IPv6 header is now. */
141195972f6Sopenharmony_ci-    iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->iphdr +
142195972f6Sopenharmony_ci+    iphdr_ptr = (struct ip6hdr*)((u8_t*)ipr->iphdr +
143195972f6Sopenharmony_ci       sizeof(struct ip6_frag_hdr));
144195972f6Sopenharmony_ci 
145195972f6Sopenharmony_ci     /* Adjust datagram length by adding header lengths. */
146195972f6Sopenharmony_ci@@ -721,8 +721,8 @@
147195972f6Sopenharmony_ci err_t
148195972f6Sopenharmony_ci ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest)
149195972f6Sopenharmony_ci {
150195972f6Sopenharmony_ci-  struct ip6_hdr *original_ip6hdr;
151195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
152195972f6Sopenharmony_ci+  struct ip6hdr *original_ip6hdr;
153195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
154195972f6Sopenharmony_ci   struct ip6_frag_hdr *frag_hdr;
155195972f6Sopenharmony_ci   struct pbuf *rambuf;
156195972f6Sopenharmony_ci #if !LWIP_NETIF_TX_SINGLE_PBUF
157195972f6Sopenharmony_ci@@ -740,7 +740,7 @@
158195972f6Sopenharmony_ci 
159195972f6Sopenharmony_ci   identification++;
160195972f6Sopenharmony_ci 
161195972f6Sopenharmony_ci-  original_ip6hdr = (struct ip6_hdr *)p->payload;
162195972f6Sopenharmony_ci+  original_ip6hdr = (struct ip6hdr *)p->payload;
163195972f6Sopenharmony_ci 
164195972f6Sopenharmony_ci   /* @todo we assume there are no options in the unfragmentable part (IPv6 header). */
165195972f6Sopenharmony_ci   LWIP_ASSERT("p->tot_len >= IP6_HLEN", p->tot_len >= IP6_HLEN);
166195972f6Sopenharmony_ci@@ -769,7 +769,7 @@
167195972f6Sopenharmony_ci     }
168195972f6Sopenharmony_ci     /* fill in the IP header */
169195972f6Sopenharmony_ci     SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN);
170195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)rambuf->payload;
171195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)rambuf->payload;
172195972f6Sopenharmony_ci     frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN);
173195972f6Sopenharmony_ci #else
174195972f6Sopenharmony_ci     /* When not using a static buffer, create a chain of pbufs.
175195972f6Sopenharmony_ci@@ -785,7 +785,7 @@
176195972f6Sopenharmony_ci     LWIP_ASSERT("this needs a pbuf in one piece!",
177195972f6Sopenharmony_ci                 (rambuf->len >= (IP6_HLEN)));
178195972f6Sopenharmony_ci     SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN);
179195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)rambuf->payload;
180195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)rambuf->payload;
181195972f6Sopenharmony_ci     frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN);
182195972f6Sopenharmony_ci 
183195972f6Sopenharmony_ci     /* Can just adjust p directly for needed offset. */
184195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/core/ipv6/nd6.c lwip-ipv6-hdr/src/core/ipv6/nd6.c
185195972f6Sopenharmony_ci--- lwip-ipv6/src/core/ipv6/nd6.c	2023-11-15 19:48:02.864481010 +0800
186195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/core/ipv6/nd6.c	2023-11-15 20:06:47.036481010 +0800
187195972f6Sopenharmony_ci@@ -895,7 +895,7 @@
188195972f6Sopenharmony_ci   case ICMP6_TYPE_PTB: /* Packet too big */
189195972f6Sopenharmony_ci   {
190195972f6Sopenharmony_ci     struct icmp6_hdr *icmp6hdr; /* Packet too big message */
191195972f6Sopenharmony_ci-    struct ip6_hdr *ip6hdr; /* IPv6 header of the packet which caused the error */
192195972f6Sopenharmony_ci+    struct ip6hdr *ip6hdr; /* IPv6 header of the packet which caused the error */
193195972f6Sopenharmony_ci     u32_t pmtu;
194195972f6Sopenharmony_ci     ip6_addr_t destination_address;
195195972f6Sopenharmony_ci 
196195972f6Sopenharmony_ci@@ -909,7 +909,7 @@
197195972f6Sopenharmony_ci     }
198195972f6Sopenharmony_ci 
199195972f6Sopenharmony_ci     icmp6hdr = (struct icmp6_hdr *)p->payload;
200195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)((u8_t*)p->payload + sizeof(struct icmp6_hdr));
201195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)((u8_t*)p->payload + sizeof(struct icmp6_hdr));
202195972f6Sopenharmony_ci 
203195972f6Sopenharmony_ci     /* Create an aligned, zoned copy of the destination address. */
204195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(destination_address, ip6hdr->dest);
205195972f6Sopenharmony_ci@@ -2187,7 +2187,7 @@
206195972f6Sopenharmony_ci static void
207195972f6Sopenharmony_ci nd6_send_q(s8_t i)
208195972f6Sopenharmony_ci {
209195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
210195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
211195972f6Sopenharmony_ci   ip6_addr_t dest;
212195972f6Sopenharmony_ci #if LWIP_ND6_QUEUEING
213195972f6Sopenharmony_ci   struct nd6_q_entry *q;
214195972f6Sopenharmony_ci@@ -2204,7 +2204,7 @@
215195972f6Sopenharmony_ci     /* pop first item off the queue */
216195972f6Sopenharmony_ci     neighbor_cache[i].q = q->next;
217195972f6Sopenharmony_ci     /* Get ipv6 header. */
218195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)(q->p->payload);
219195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)(q->p->payload);
220195972f6Sopenharmony_ci     /* Create an aligned copy. */
221195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(dest, ip6hdr->dest);
222195972f6Sopenharmony_ci     /* Restore the zone, if applicable. */
223195972f6Sopenharmony_ci@@ -2219,7 +2219,7 @@
224195972f6Sopenharmony_ci #else /* LWIP_ND6_QUEUEING */
225195972f6Sopenharmony_ci   if (neighbor_cache[i].q != NULL) {
226195972f6Sopenharmony_ci     /* Get ipv6 header. */
227195972f6Sopenharmony_ci-    ip6hdr = (struct ip6_hdr *)(neighbor_cache[i].q->payload);
228195972f6Sopenharmony_ci+    ip6hdr = (struct ip6hdr *)(neighbor_cache[i].q->payload);
229195972f6Sopenharmony_ci     /* Create an aligned copy. */
230195972f6Sopenharmony_ci     ip6_addr_copy_from_packed(dest, ip6hdr->dest);
231195972f6Sopenharmony_ci     /* Restore the zone, if applicable. */
232195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/core/raw.c lwip-ipv6-hdr/src/core/raw.c
233195972f6Sopenharmony_ci--- lwip-ipv6/src/core/raw.c	2023-11-15 19:48:02.860481010 +0800
234195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/core/raw.c	2023-11-15 19:49:53.468481010 +0800
235195972f6Sopenharmony_ci@@ -146,7 +146,7 @@
236195972f6Sopenharmony_ci   if (IP_HDR_GET_VERSION(p->payload) == 6)
237195972f6Sopenharmony_ci #endif /* LWIP_IPV4 */
238195972f6Sopenharmony_ci   {
239195972f6Sopenharmony_ci-    struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload;
240195972f6Sopenharmony_ci+    struct ip6hdr *ip6hdr = (struct ip6hdr *)p->payload;
241195972f6Sopenharmony_ci     proto = IP6H_NEXTH(ip6hdr);
242195972f6Sopenharmony_ci   }
243195972f6Sopenharmony_ci #if LWIP_IPV4
244195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/include/lwip/ip6_frag.h lwip-ipv6-hdr/src/include/lwip/ip6_frag.h
245195972f6Sopenharmony_ci--- lwip-ipv6/src/include/lwip/ip6_frag.h	2023-11-15 19:48:02.864481010 +0800
246195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/include/lwip/ip6_frag.h	2023-11-15 20:13:40.008481010 +0800
247195972f6Sopenharmony_ci@@ -90,7 +90,7 @@
248195972f6Sopenharmony_ci struct ip6_reassdata {
249195972f6Sopenharmony_ci   struct ip6_reassdata *next;
250195972f6Sopenharmony_ci   struct pbuf *p;
251195972f6Sopenharmony_ci-  struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */
252195972f6Sopenharmony_ci+  struct ip6hdr *iphdr; /* pointer to the first (original) IPv6 header */
253195972f6Sopenharmony_ci #if IPV6_FRAG_COPYHEADER
254195972f6Sopenharmony_ci   ip6_addr_p_t src; /* copy of the source address in the IP header */
255195972f6Sopenharmony_ci   ip6_addr_p_t dest; /* copy of the destination address in the IP header */
256195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/include/lwip/ip.h lwip-ipv6-hdr/src/include/lwip/ip.h
257195972f6Sopenharmony_ci--- lwip-ipv6/src/include/lwip/ip.h	2023-11-15 19:48:02.864481010 +0800
258195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/include/lwip/ip.h	2023-11-15 20:12:42.796481010 +0800
259195972f6Sopenharmony_ci@@ -123,7 +123,7 @@
260195972f6Sopenharmony_ci #endif /* LWIP_IPV4 */
261195972f6Sopenharmony_ci #if LWIP_IPV6
262195972f6Sopenharmony_ci   /** Header of the input IPv6 packet currently being processed. */
263195972f6Sopenharmony_ci-  struct ip6_hdr *current_ip6_header;
264195972f6Sopenharmony_ci+  struct ip6hdr *current_ip6_header;
265195972f6Sopenharmony_ci #endif /* LWIP_IPV6 */
266195972f6Sopenharmony_ci   /** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */
267195972f6Sopenharmony_ci   u16_t current_ip_header_tot_len;
268195972f6Sopenharmony_ci@@ -159,7 +159,7 @@
269195972f6Sopenharmony_ci /** Get the IPv6 header of the current packet.
270195972f6Sopenharmony_ci  * This function must only be called from a receive callback (udp_recv,
271195972f6Sopenharmony_ci  * raw_recv, tcp_accept). It will return NULL otherwise. */
272195972f6Sopenharmony_ci-#define ip6_current_header()      ((const struct ip6_hdr*)(ip_data.current_ip6_header))
273195972f6Sopenharmony_ci+#define ip6_current_header()      ((const struct ip6hdr*)(ip_data.current_ip6_header))
274195972f6Sopenharmony_ci /** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */
275195972f6Sopenharmony_ci #define ip_current_is_v6()        (ip6_current_header() != NULL)
276195972f6Sopenharmony_ci /** Source IPv6 address of current_header */
277195972f6Sopenharmony_ci@@ -201,7 +201,7 @@
278195972f6Sopenharmony_ci /** Get the IPv6 header of the current packet.
279195972f6Sopenharmony_ci  * This function must only be called from a receive callback (udp_recv,
280195972f6Sopenharmony_ci  * raw_recv, tcp_accept). It will return NULL otherwise. */
281195972f6Sopenharmony_ci-#define ip6_current_header()      ((const struct ip6_hdr*)(ip_data.current_ip6_header))
282195972f6Sopenharmony_ci+#define ip6_current_header()      ((const struct ip6hdr*)(ip_data.current_ip6_header))
283195972f6Sopenharmony_ci /** Always returns TRUE when only supporting IPv6 only */
284195972f6Sopenharmony_ci #define ip_current_is_v6()        1
285195972f6Sopenharmony_ci /** Get the transport layer protocol */
286195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/include/lwip/prot/ip6.h lwip-ipv6-hdr/src/include/lwip/prot/ip6.h
287195972f6Sopenharmony_ci--- lwip-ipv6/src/include/lwip/prot/ip6.h	2023-11-15 19:48:02.868481010 +0800
288195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/include/lwip/prot/ip6.h	2023-11-17 13:24:56.832481010 +0800
289195972f6Sopenharmony_ci@@ -79,7 +79,7 @@
290195972f6Sopenharmony_ci #  include "arch/bpstruct.h"
291195972f6Sopenharmony_ci #endif
292195972f6Sopenharmony_ci PACK_STRUCT_BEGIN
293195972f6Sopenharmony_ci-struct ip6_hdr {
294195972f6Sopenharmony_ci+struct ip6hdr {
295195972f6Sopenharmony_ci   /** version / traffic class / flow label */
296195972f6Sopenharmony_ci   PACK_STRUCT_FIELD(u32_t _v_tc_fl);
297195972f6Sopenharmony_ci   /** payload length */
298195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/netif/lowpan6.c lwip-ipv6-hdr/src/netif/lowpan6.c
299195972f6Sopenharmony_ci--- lwip-ipv6/src/netif/lowpan6.c	2023-11-15 19:48:02.868481010 +0800
300195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/netif/lowpan6.c	2023-11-15 20:16:23.836481010 +0800
301195972f6Sopenharmony_ci@@ -570,12 +570,12 @@
302195972f6Sopenharmony_ci   struct lowpan6_link_addr src, dest;
303195972f6Sopenharmony_ci #if LWIP_6LOWPAN_INFER_SHORT_ADDRESS
304195972f6Sopenharmony_ci   ip6_addr_t ip6_src;
305195972f6Sopenharmony_ci-  struct ip6_hdr *ip6_hdr;
306195972f6Sopenharmony_ci+  struct ip6hdr *ip6_hdr;
307195972f6Sopenharmony_ci #endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */
308195972f6Sopenharmony_ci 
309195972f6Sopenharmony_ci #if LWIP_6LOWPAN_INFER_SHORT_ADDRESS
310195972f6Sopenharmony_ci   /* Check if we can compress source address (use aligned copy) */
311195972f6Sopenharmony_ci-  ip6_hdr = (struct ip6_hdr *)q->payload;
312195972f6Sopenharmony_ci+  ip6_hdr = (struct ip6hdr *)q->payload;
313195972f6Sopenharmony_ci   ip6_addr_copy_from_packed(ip6_src, ip6_hdr->src);
314195972f6Sopenharmony_ci   ip6_addr_assign_zone(&ip6_src, IP6_UNICAST, netif);
315195972f6Sopenharmony_ci   if (lowpan6_get_address_mode(&ip6_src, &short_mac_addr) == 3) {
316195972f6Sopenharmony_cidiff -Nur lwip-ipv6/src/netif/lowpan6_common.c lwip-ipv6-hdr/src/netif/lowpan6_common.c
317195972f6Sopenharmony_ci--- lwip-ipv6/src/netif/lowpan6_common.c	2023-11-15 19:48:02.868481010 +0800
318195972f6Sopenharmony_ci+++ lwip-ipv6-hdr/src/netif/lowpan6_common.c	2023-11-15 20:15:44.460481010 +0800
319195972f6Sopenharmony_ci@@ -137,7 +137,7 @@
320195972f6Sopenharmony_ci   u8_t lowpan6_header_len;
321195972f6Sopenharmony_ci   u8_t hidden_header_len = 0;
322195972f6Sopenharmony_ci   s8_t i;
323195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
324195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
325195972f6Sopenharmony_ci   ip_addr_t ip6src, ip6dst;
326195972f6Sopenharmony_ci 
327195972f6Sopenharmony_ci   LWIP_ASSERT("netif != NULL", netif != NULL);
328195972f6Sopenharmony_ci@@ -160,7 +160,7 @@
329195972f6Sopenharmony_ci   }
330195972f6Sopenharmony_ci 
331195972f6Sopenharmony_ci   /* Point to ip6 header and align copies of src/dest addresses. */
332195972f6Sopenharmony_ci-  ip6hdr = (struct ip6_hdr *)inptr;
333195972f6Sopenharmony_ci+  ip6hdr = (struct ip6hdr *)inptr;
334195972f6Sopenharmony_ci   ip_addr_copy_from_ip6_packed(ip6dst, ip6hdr->dest);
335195972f6Sopenharmony_ci   ip6_addr_assign_zone(ip_2_ip6(&ip6dst), IP6_UNKNOWN, netif);
336195972f6Sopenharmony_ci   ip_addr_copy_from_ip6_packed(ip6src, ip6hdr->src);
337195972f6Sopenharmony_ci@@ -396,7 +396,7 @@
338195972f6Sopenharmony_ci                        struct lowpan6_link_addr *src, struct lowpan6_link_addr *dest)
339195972f6Sopenharmony_ci {
340195972f6Sopenharmony_ci   u16_t lowpan6_offset;
341195972f6Sopenharmony_ci-  struct ip6_hdr *ip6hdr;
342195972f6Sopenharmony_ci+  struct ip6hdr *ip6hdr;
343195972f6Sopenharmony_ci   s8_t i;
344195972f6Sopenharmony_ci   u32_t header_temp;
345195972f6Sopenharmony_ci   u16_t ip6_offset = IP6_HLEN;
346195972f6Sopenharmony_ci@@ -408,7 +408,7 @@
347195972f6Sopenharmony_ci   LWIP_ASSERT("hdr_size_comp != NULL", hdr_size_comp != NULL);
348195972f6Sopenharmony_ci   LWIP_ASSERT("dehdr_size_decompst != NULL", hdr_size_decomp != NULL);
349195972f6Sopenharmony_ci 
350195972f6Sopenharmony_ci-  ip6hdr = (struct ip6_hdr *)decomp_buffer;
351195972f6Sopenharmony_ci+  ip6hdr = (struct ip6hdr *)decomp_buffer;
352195972f6Sopenharmony_ci   if (decomp_bufsize < IP6_HLEN) {
353195972f6Sopenharmony_ci     return ERR_MEM;
354195972f6Sopenharmony_ci   }
355