mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-29 00:32:51 +00:00
Fix icmp6_send_response: cannot assign (packed) ip6_addr_p_t* to ip6_addr_t* -> need to copy the packed address to an aligned address first
This commit is contained in:
parent
440f31a4d3
commit
96d332e234
@ -258,6 +258,7 @@ icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type)
|
|||||||
struct pbuf *q;
|
struct pbuf *q;
|
||||||
struct icmp6_hdr *icmp6hdr;
|
struct icmp6_hdr *icmp6hdr;
|
||||||
ip6_addr_t *reply_src, *reply_dest;
|
ip6_addr_t *reply_src, *reply_dest;
|
||||||
|
ip6_addr_t reply_src_local, reply_dest_local;
|
||||||
struct ip6_hdr *ip6hdr;
|
struct ip6_hdr *ip6hdr;
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
|
|
||||||
@ -291,8 +292,11 @@ icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type)
|
|||||||
* addresses from the packet in question. reply_src is temporarily
|
* addresses from the packet in question. reply_src is temporarily
|
||||||
* set to try and find the original netif where packet was accepted. */
|
* set to try and find the original netif where packet was accepted. */
|
||||||
ip6hdr = (struct ip6_hdr *)p->payload;
|
ip6hdr = (struct ip6_hdr *)p->payload;
|
||||||
reply_dest = &ip6hdr->src;
|
/* copy from packed address to aligned address */
|
||||||
reply_src = &ip6hdr->dest;
|
ip6_addr_copy(reply_dest_local, ip6hdr->src);
|
||||||
|
ip6_addr_copy(reply_src_local, ip6hdr->dest);
|
||||||
|
reply_dest = &reply_dest_local;
|
||||||
|
reply_src = &reply_src_local;
|
||||||
netif = ip6_route(reply_src, reply_dest);
|
netif = ip6_route(reply_src, reply_dest);
|
||||||
if (netif == NULL) {
|
if (netif == NULL) {
|
||||||
/* drop */
|
/* drop */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user