Skip to contentSkip to conversation

net: Fix incorrect condition for calling grub_net_tcp_retransmit()

PATCH In review Glenn Washburn 2 participants 2 messages May 12, 2022 – May 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Fix incorrect condition for calling grub_net_tcp_retransmit()

The commit 848724273e4 (net/net: Avoid unnecessary calls to grub_net_tcp_retransmit()) needs to have its condition inverted to avoid unnecessary calls to grub_net_tcp_retransmit(). As it is, it creates many unnecessary calls and does not call grub_net_tcp_retransmit() when needed. The call to grub_net_tcp_retransmit() should only be made when grub_net_cards does _not_ equal NULL, meaning that there are potentially network cards that need tcp retransmission.

---
 grub-core/net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/net/net.c +1 -1
index 88ea49fee..2b6771523 100644
@@ -1634,7 +1634,7 @@ grub_net_poll_cards_idle_real (void)
 	|| ctime >= card->last_poll + card->idle_poll_delay_ms)
       receive_packets (card, 0);
   }
-  if (grub_net_cards == NULL)
+  if (grub_net_cards != NULL)
     grub_net_tcp_retransmit ();
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Glenn Washburn

The commit 848724273e4 (net/net: Avoid unnecessary calls to grub_net_tcp_retransmit()) needs to have its condition inverted to avoid unnecessary calls to grub_net_tcp_retransmit(). As it is, it creates many unnecessary calls and does not call grub_net_tcp_retransmit() when needed. The call to grub_net_tcp_retransmit() should only be made when grub_net_cards does _not_ equal NULL, meaning that there are potentially network cards that need tcp retransmission.

Daniel