/*
- * Copyright (c) 2014 Nicira, Inc.
+ * Copyright (c) 2014, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int
get_unix_name_len(const struct sockaddr_un *sun, socklen_t sun_len)
{
- return (sun_len >= offsetof(struct sockaddr_un, sun_path) &&
+ return (sun_len > offsetof(struct sockaddr_un, sun_path) &&
sun->sun_path[0] != 0
? sun_len - offsetof(struct sockaddr_un, sun_path)
: 0);