From 010c2b81921e7334a7fdde70e6dc0cdf1eb24c98 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 25 Dec 2013 20:08:44 +0000 Subject: [PATCH] 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 --- sys/netinet6/in6_mcast.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 90239cfac131..d2fdcdc7e1a2 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -1851,8 +1851,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sopt) if (mreq.ipv6mr_interface == 0) { ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6); } else { - if (mreq.ipv6mr_interface < 0 || - V_if_index < mreq.ipv6mr_interface) + if (V_if_index < mreq.ipv6mr_interface) return (EADDRNOTAVAIL); 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. */ if (ifindex != 0) { - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EADDRNOTAVAIL); ifp = ifnet_byindex(ifindex); 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)); if (error) return (error); - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EINVAL); ifp = ifnet_byindex(ifindex);