Correct warnings comparing unsigned variables < 0 constantly reported

while building kernels.  All instances removed are indeed unsigned so
the expressions could not be true.

MFC after:	1 week
This commit is contained in:
bz 2013-12-25 20:08:44 +00:00
parent 3dc5336e2e
commit 1b0023f911

View File

@ -1851,8 +1851,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sopt)
if (mreq.ipv6mr_interface == 0) { if (mreq.ipv6mr_interface == 0) {
ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6); ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6);
} else { } else {
if (mreq.ipv6mr_interface < 0 || if (V_if_index < mreq.ipv6mr_interface)
V_if_index < mreq.ipv6mr_interface)
return (EADDRNOTAVAIL); return (EADDRNOTAVAIL);
ifp = ifnet_byindex(mreq.ipv6mr_interface); ifp = ifnet_byindex(mreq.ipv6mr_interface);
} }
@ -2198,7 +2197,7 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *sopt)
* XXX SCOPE6 lock potentially taken here. * XXX SCOPE6 lock potentially taken here.
*/ */
if (ifindex != 0) { if (ifindex != 0) {
if (ifindex < 0 || V_if_index < ifindex) if (V_if_index < ifindex)
return (EADDRNOTAVAIL); return (EADDRNOTAVAIL);
ifp = ifnet_byindex(ifindex); ifp = ifnet_byindex(ifindex);
if (ifp == NULL) if (ifp == NULL)
@ -2356,7 +2355,7 @@ in6p_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
error = sooptcopyin(sopt, &ifindex, sizeof(u_int), sizeof(u_int)); error = sooptcopyin(sopt, &ifindex, sizeof(u_int), sizeof(u_int));
if (error) if (error)
return (error); return (error);
if (ifindex < 0 || V_if_index < ifindex) if (V_if_index < ifindex)
return (EINVAL); return (EINVAL);
ifp = ifnet_byindex(ifindex); ifp = ifnet_byindex(ifindex);