Skip to content

Commit

Permalink
lwip: fix gcc -fanalyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapshin authored and david-cermak committed Jun 6, 2024
1 parent f174681 commit 4297782
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/ipv6/icmp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,12 @@ icmp6_send_response_with_addrs_and_netif(struct pbuf *p, u8_t code, u32_t data,
{
struct pbuf *q;
struct icmp6_hdr *icmp6hdr;
u16_t datalen = LWIP_MIN(p->tot_len, LWIP_ICMP6_DATASIZE);
u16_t datalen;
u16_t offset;

LWIP_ASSERT("pbuf is NULL", p != NULL);

datalen = LWIP_MIN(p->tot_len, LWIP_ICMP6_DATASIZE);
/* ICMPv6 header + datalen (as much of the offending packet as possible) */
q = pbuf_alloc(PBUF_IP, sizeof(struct icmp6_hdr) + datalen,
PBUF_RAM);
Expand Down
1 change: 1 addition & 0 deletions src/core/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip,
if (IP_IS_V4MAPPEDV6(dst_ip)) {
ip_addr_t dest_ipv4;
unmap_ipv4_mapped_ipv6(ip_2_ip4(&dest_ipv4), ip_2_ip6(dst_ip));
IP_SET_TYPE_VAL(dest_ipv4, IPADDR_TYPE_V4);
#if LWIP_CHECKSUM_ON_COPY
return udp_sendto_chksum(pcb, p, &dest_ipv4, dst_port, have_chksum, chksum);
#else
Expand Down

0 comments on commit 4297782

Please sign in to comment.