Subject: Re: [RFC] iproute2: Fix meta match u32 with 0xffffffff

From: Thomas Graf <[email-masked]>
Date: Tue, 12 Apr 2011 19:22:05 +0200

On Tue, 2011-04-12 at 08:19 -0700, Stephen Hemminger wrote:

> > 
> > This is definitely much better but we still can't parse ULONG_MAX
> > as string representative. Checking glibc docs, the only way to do it is
> > to ignore the return value for error checking and look errno.
> > 
> 
> I think the error case is ret == ULONG_MAX && errno == ERANGE
> If there is no error, then strtoul doesn't set errno.

That's ok too but your patch adds ret == ULONG_MAX || errno == ERANGE
which will not allow to parse ULONG_MAX as a string. You probably
still have to clear errno to 0 before calling strtoul in case
ULONG_MAX is meant as legitimate return value but a previous glibc
function has left errno set to ERANGE.