Previously since proto was __u8 an invalid proto would
be allowed. Gcc warns about never true conditional
since __u8 can never be negative.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
static int ct_parse_helper(char *str, struct nlmsghdr *n)
{
char f[32], p[32], name[32];
- __u8 family, proto;
+ __u8 family;
+ int proto;
if (strlen(str) >= 32 ||
sscanf(str, "%[^-]-%[^-]-%[^-]", f, p, name) != 3)
family = AF_INET6;
else
return -1;
+
proto = inet_proto_a2n(p);
if (proto < 0)
return -1;