]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
net/net: Avoid unnecessary calls to grub_net_tcp_retransmit()
authorGlenn Washburn <development@efficientek.com>
Fri, 18 Mar 2022 06:51:32 +0000 (01:51 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 4 Apr 2022 17:43:35 +0000 (19:43 +0200)
In grub_net_poll_cards_idle_real(), only call grub_net_tcp_retransmit() if there
are network cards found. If there are no network card found, there can be no
tcp sockets to transmit on. So no need to go through that logic.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/net/net.c

index 3eac83d165975ddc5b71af1d00beb0623700f433..11b39877b993678d2d84e8bd091cfa55b4cad9c6 100644 (file)
@@ -1580,7 +1580,8 @@ grub_net_poll_cards_idle_real (void)
        || ctime >= card->last_poll + card->idle_poll_delay_ms)
       receive_packets (card, 0);
   }
-  grub_net_tcp_retransmit ();
+  if (grub_net_cards == NULL)
+    grub_net_tcp_retransmit ();
 }
 
 /*  Read from the packets list*/