PUD: only do a single loopback
authorFerry Huberts <f.huberts@mindef.nl>
Mon, 18 Jul 2011 11:09:07 +0000 (13:09 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Tue, 19 Jul 2011 11:05:51 +0000 (13:05 +0200)
Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/src/receiver.c

index 6611812..97e0838 100644 (file)
@@ -210,12 +210,6 @@ static void txToAllOlsrInterfaces(void) {
                for (ifn = ifnet; ifn; ifn = ifn->int_next) {
                        nodeIdPreTransmitHook((union olsr_message *) txBuffer, ifn);
 
-                       /* loopback to tx interface when so configured */
-                       if (getUseLoopback()) {
-                               (void) packetReceivedFromOlsr(
-                                               (union olsr_message *) &txBuffer[0], NULL, NULL);
-                       }
-
 #ifdef PUD_DUMP_GPS_PACKETS_TX_OLSR
                        olsr_printf(0, "%s: packet sent to OLSR interface %s (%d bytes)\n",
                                        PUD_PLUGIN_ABBR, ifn->int_name, aligned_size);
@@ -234,6 +228,12 @@ static void txToAllOlsrInterfaces(void) {
                                                                                : "unknown reason"), aligned_size, r);
                        }
                }
+
+               /* loopback to tx interface when so configured */
+               if (getUseLoopback()) {
+                       (void) packetReceivedFromOlsr(
+                                       (union olsr_message *) &txBuffer[0], NULL, NULL);
+               }
        }
 }