diff --git a/net/local/local.h b/net/local/local.h index 075254f048..a3f4b9ab23 100644 --- a/net/local/local.h +++ b/net/local/local.h @@ -57,8 +57,7 @@ enum local_type_e { - LOCAL_TYPE_UNTYPED = 0, /* Type is not determined until the socket is bound */ - LOCAL_TYPE_UNNAMED, /* A Unix socket that is not bound to any name */ + LOCAL_TYPE_UNNAMED = 0, /* A Unix socket that is not bound to any name */ LOCAL_TYPE_PATHNAME, /* lc_path holds a null terminated string */ LOCAL_TYPE_ABSTRACT /* lc_path is length zero */ }; diff --git a/net/local/local_connect.c b/net/local/local_connect.c index 3ffc3314d7..e5e9ca88e3 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -266,6 +266,8 @@ int psock_local_connect(FAR struct socket *psock, switch (conn->lc_type) { case LOCAL_TYPE_UNNAMED: /* A Unix socket that is not bound to any name */ + break; + case LOCAL_TYPE_ABSTRACT: /* lc_path is length zero */ { #warning Missing logic @@ -314,14 +316,10 @@ int psock_local_connect(FAR struct socket *psock, } break; - default: /* Bad, memory must be corrupted */ - DEBUGPANIC(); /* PANIC if debug on, else fall through */ - - case LOCAL_TYPE_UNTYPED: /* Type is not determined until the socket is bound */ - { - net_unlock(); - return -EINVAL; - } + default: /* Bad, memory must be corrupted */ + DEBUGPANIC(); /* PANIC if debug on */ + net_unlock(); + return -EINVAL; } }