Re: [PATCH] Incorrect xt_iprange boundary check for IPv6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 2011-01-24 12:31, Thomas Jacob wrote:
>
>if (info->flags & IPRANGE_SRC) {
>  m  = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6);
>  m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr);
>  m ^= !!(info->flags & IPRANGE_SRC_INV);
>  if (m)
>    return false;
>}
>
>Shouldn't this be  m ||= ..

C does not have a ||= operator. This is not Perl.
Which is why either you make sure iprange_ipv6_lt returns a bool,
or force one by means of !!.

>to allow for some short circuit optimizations?

Since there is no ||=, it would be

m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6);
if (!m)
	m = iprange_ipv6_lt(&info->src_max.in6, &iph->saddr);
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux