pud: firm up setupNodeIdBinaryAndValidate
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 1 Oct 2013 10:26:04 +0000 (12:26 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 1 Oct 2013 12:44:12 +0000 (14:44 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/configuration.c

index 79929d9..854bd47 100644 (file)
@@ -253,6 +253,10 @@ static bool setupNodeIdBinaryAndValidate(NodeIdType nodeIdTypeNumber) {
                case PUD_NODEIDTYPE_DNS: /* DNS name */
                        return intSetupNodeIdBinaryString();
 
+               case PUD_NODEIDTYPE_IPV4: /* IPv4 address */
+               case PUD_NODEIDTYPE_IPV6: /* IPv6 address */
+                       return intSetupNodeIdBinaryIp();
+
                case PUD_NODEIDTYPE_MMSI: /* an AIS MMSI number */
                        return intSetupNodeIdBinaryLongLong(PUD_NODEIDTYPE_MMSI_MIN,
                                PUD_NODEIDTYPE_MMSI_MAX, PUD_NODEIDTYPE_MMSI_BYTES);
@@ -273,10 +277,9 @@ static bool setupNodeIdBinaryAndValidate(NodeIdType nodeIdTypeNumber) {
                        return intSetupNodeIdBinaryLongLong(PUD_NODEIDTYPE_194_MIN,
                                PUD_NODEIDTYPE_194_MAX, PUD_NODEIDTYPE_194_BYTES);
 
-               case PUD_NODEIDTYPE_IPV4: /* IPv4 address */
-               case PUD_NODEIDTYPE_IPV6: /* IPv6 address */
-               default: /* unsupported */
-                       return intSetupNodeIdBinaryIp();
+               default:
+                 pudError(false, "nodeId type %u is not supported", nodeIdTypeNumber);
+                 return false;
        }
 
        return false;