libc/net: fix a portability issue

* POSIX does not require socklen_t to be  unsigned

Submitted by:	bde
MFC After:	1 week (with r261454)
This commit is contained in:
eadler 2014-02-05 02:00:31 +00:00
parent 11e536cc2d
commit 693a7c1ac2

View File

@ -382,7 +382,7 @@ inet6_opt_init(void *extbuf, socklen_t extlen)
struct ip6_ext *ext = (struct ip6_ext *)extbuf;
if (ext) {
if (extlen == 0 || (extlen % 8))
if (extlen <= 0 || (extlen % 8))
return(-1);
ext->ip6e_len = (extlen >> 3) - 1;
}