mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
fix NULL checks (compiler error, tcp_rst allows pcb==NULL)
This commit is contained in:
parent
31bc2f9b20
commit
e7c0619189
@ -1534,10 +1534,13 @@ tcp_txnow(void)
|
|||||||
err_t
|
err_t
|
||||||
tcp_process_refused_data(struct tcp_pcb *pcb)
|
tcp_process_refused_data(struct tcp_pcb *pcb)
|
||||||
{
|
{
|
||||||
|
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
|
||||||
|
struct pbuf *rest;
|
||||||
|
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
|
||||||
|
|
||||||
LWIP_ERROR("tcp_process_refused_data: invalid pcb", pcb != NULL, return ERR_ARG);
|
LWIP_ERROR("tcp_process_refused_data: invalid pcb", pcb != NULL, return ERR_ARG);
|
||||||
|
|
||||||
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
|
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
|
||||||
struct pbuf *rest;
|
|
||||||
while (pcb->refused_data != NULL)
|
while (pcb->refused_data != NULL)
|
||||||
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
|
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
|
||||||
{
|
{
|
||||||
|
@ -1886,7 +1886,7 @@ tcp_output_fill_options(const struct tcp_pcb *pcb, struct pbuf *p, u8_t optflags
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LWIP_TCP_SACK_OUT
|
#if LWIP_TCP_SACK_OUT
|
||||||
if (num_sacks > 0) {
|
if (pcb && (num_sacks > 0)) {
|
||||||
tcp_build_sack_option(pcb, opts, num_sacks);
|
tcp_build_sack_option(pcb, opts, num_sacks);
|
||||||
/* 1 word for SACKs header (including 2xNOP), and 2 words for each SACK */
|
/* 1 word for SACKs header (including 2xNOP), and 2 words for each SACK */
|
||||||
sacks_len = 1 + num_sacks * 2;
|
sacks_len = 1 + num_sacks * 2;
|
||||||
@ -1979,7 +1979,6 @@ tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
|
|||||||
u16_t wnd;
|
u16_t wnd;
|
||||||
u8_t optlen;
|
u8_t optlen;
|
||||||
|
|
||||||
LWIP_ASSERT("tcp_rst: invalid pcb", pcb != NULL);
|
|
||||||
LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL);
|
LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL);
|
||||||
LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL);
|
LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user