PUD: fix nodeIdType == 0 outputing IP address i.s.o. MAC address
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 23 Jun 2011 12:29:00 +0000 (14:29 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 23 Jun 2011 12:29:33 +0000 (14:29 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/nodeIdConversion.c

index e109ebd..6af03bf 100644 (file)
@@ -378,7 +378,8 @@ void getNodeInfoFromOlsr(const union olsr_message *olsrMessage,
 
                /* nodeIdType */
                chars = snprintf(&nodeIdTypeString[0], PUD_TX_NODEIDTYPE_DIGITS + 1,
-                               "%u", olsrGpsMessage->nodeInfo.nodeIdType);
+                               "%u", ((olsr_cnf->ip_version == AF_INET) ? PUD_NODEIDTYPE_IPV4
+                               : PUD_NODEIDTYPE_IPV6));
                if (likely(chars < PUD_TX_NODEIDTYPE_DIGITS)) {
                        nodeIdTypeString[chars] = '\0';
                } else {