PUD: fix nodeIdPreTransmitHook for MAC address usage
authorFerry Huberts <f.huberts@mindef.nl>
Thu, 21 Jul 2011 09:53:50 +0000 (11:53 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Thu, 21 Jul 2011 09:53:50 +0000 (11:53 +0200)
It did not copy the correct number of bytes

Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/src/receiver.c

index 35c6f80..d178d09 100644 (file)
@@ -144,11 +144,11 @@ static void nodeIdPreTransmitHook(union olsr_message *olsrMessage,
 
                if (likely(olsrIf != NULL)) {
                        memcpy(&olsrGpsMessage->nodeInfo.nodeId, &olsrIf->hwAddress[0],
-                                       sizeof(PUD_HWADDR_SIZE));
+                                       PUD_HWADDR_SIZE);
                } else {
                        pudError(false, "Could not find OLSR interface %s, cleared its"
                                " MAC address in the OLSR message\n", ifn->int_name);
-                       memset(&olsrGpsMessage->nodeInfo.nodeId, 0, sizeof(PUD_HWADDR_SIZE));
+                       memset(&olsrGpsMessage->nodeInfo.nodeId, 0, PUD_HWADDR_SIZE);
                }
        }
 }