mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 15:16:02 +00:00
ICMP: Fix unused value in icmp_input (found by Coverity)
This commit is contained in:
parent
e5eba61cf0
commit
11b810721a
|
@ -81,7 +81,6 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
||||||
#endif /* LWIP_DEBUG */
|
#endif /* LWIP_DEBUG */
|
||||||
struct icmp_echo_hdr *iecho;
|
struct icmp_echo_hdr *iecho;
|
||||||
const struct ip_hdr *iphdr_in;
|
const struct ip_hdr *iphdr_in;
|
||||||
struct ip_hdr *iphdr;
|
|
||||||
s16_t hlen;
|
s16_t hlen;
|
||||||
const ip4_addr_t* src;
|
const ip4_addr_t* src;
|
||||||
|
|
||||||
|
@ -160,7 +159,6 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
||||||
(r->len >= hlen + sizeof(struct icmp_echo_hdr)));
|
(r->len >= hlen + sizeof(struct icmp_echo_hdr)));
|
||||||
/* copy the ip header */
|
/* copy the ip header */
|
||||||
MEMCPY(r->payload, iphdr_in, hlen);
|
MEMCPY(r->payload, iphdr_in, hlen);
|
||||||
iphdr = (struct ip_hdr *)r->payload;
|
|
||||||
/* switch r->payload back to icmp header */
|
/* switch r->payload back to icmp header */
|
||||||
if (pbuf_header(r, -hlen)) {
|
if (pbuf_header(r, -hlen)) {
|
||||||
LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed\n", 0);
|
LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed\n", 0);
|
||||||
|
@ -193,7 +191,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
||||||
LWIP_ASSERT("Can't move over header in packet", 0);
|
LWIP_ASSERT("Can't move over header in packet", 0);
|
||||||
} else {
|
} else {
|
||||||
err_t ret;
|
err_t ret;
|
||||||
iphdr = (struct ip_hdr*)p->payload;
|
struct ip_hdr *iphdr = (struct ip_hdr*)p->payload;
|
||||||
ip4_addr_copy(iphdr->src, *src);
|
ip4_addr_copy(iphdr->src, *src);
|
||||||
ip4_addr_copy(iphdr->dest, *ip4_current_src_addr());
|
ip4_addr_copy(iphdr->dest, *ip4_current_src_addr());
|
||||||
ICMPH_TYPE_SET(iecho, ICMP_ER);
|
ICMPH_TYPE_SET(iecho, ICMP_ER);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user