diff mbox series

macaddr: ignore the checking from index to 0xFF

Message ID CAOYM0N1sbP=xRfNPaNK6ZzzhD3A-5PKimaeSrDzXHGxAYH3oCQ@mail.gmail.com (mailing list archive)
State New
Headers show
Series macaddr: ignore the checking from index to 0xFF | expand

Commit Message

Liu Jaloo Dec. 24, 2024, 3:27 a.m. UTC
bash-5.1$ git diff net/net.c
diff mbox series

Patch

diff --git a/net/net.c b/net/net.c
index c1bb19a523..af68029428 100644
--- a/net/net.c
+++ b/net/net.c
@@ -173,6 +173,7 @@  static void qemu_macaddr_set_used(MACAddr *macaddr)
     for (index = 0x56; index < 0xFF; index++) {
         if (macaddr->a[5] == index) {
             mac_table[index]++;
+           return;
         }
     }
 }
@@ -188,6 +189,7 @@  static void qemu_macaddr_set_free(MACAddr *macaddr)
     for (index = 0x56; index < 0xFF; index++) {
         if (macaddr->a[5] == index) {
             mac_table[index]--;
+           return;
         }
     }
 }