On 10/22/2019 5:08 PM, Jakub Grajciar wrote:
> Define MEMIF_SOCKET_UN_SIZE to size of unix domain socket address.
> Report error in case of longer path.
> 
> Fixes: b923866c6974 ("net/memif: allow for full key size in socket name")
> Cc: step...@networkplumber.org
> 
> Signed-off-by: Jakub Grajciar <jgraj...@cisco.com>

<...>

> +  if (strlen(filename) != MEMIF_SOCKET_UN_SIZE) {
> +             MIF_LOG(ERR, "Unix socket address too long (max 108).");
> +             return -1;
> +     }

Are you sure about this check, I didn't test it but intention looks like ">=".

btw, it is possible to print 'MEMIF_SOCKET_UN_SIZE' as max value, instead of
hardcoded '108'.

Reply via email to