Discussion:
iptables return code 256
Ralf
2009-02-20 20:33:48 UTC
Permalink
Sometimes an insert operation (-I) fails and iptables returns 256.
Under which circumstances can iptables give a return code 256 ?

(I guess it happens when an internal resource is in locked state
when user issues the iptables command, right?)

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jan Engelhardt
2009-02-20 20:35:48 UTC
Permalink
Post by Ralf
Sometimes an insert operation (-I) fails and iptables returns 256.
Under which circumstances can iptables give a return code 256 ?
Never should this happen, because the lower 8 bits of 256 that
make up the exist status are 0 actually.
Or where do you see 256?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ralf
2009-02-20 21:58:37 UTC
Permalink
Post by Jan Engelhardt
Post by Ralf
Sometimes an insert operation (-I) fails and iptables returns 256.
Under which circumstances can iptables give a return code 256 ?
Never should this happen, because the lower 8 bits of 256 that
make up the exist status are 0 actually.
Or where do you see 256?
int rc = system(sz); // sz="iptables ..."

rc is sometimes definitely 256 !

What does it mean?

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jan Engelhardt
2009-02-20 22:10:24 UTC
Permalink
Post by Ralf
Post by Jan Engelhardt
Post by Ralf
Sometimes an insert operation (-I) fails and iptables returns 256.
Under which circumstances can iptables give a return code 256 ?
Never should this happen, because the lower 8 bits of 256 that
make up the exist status are 0 actually.
Or where do you see 256?
[I thought about $? first...]
Post by Ralf
int rc = system(sz); // sz="iptables ..."
rc is sometimes definitely 256 !
What does it mean?
Humph humph, this is not a C forum!

man 3 system:

RETURN VALUE
The value returned is -1 on error (e.g. fork(2) failed), and the
return status of the command otherwise. This latter return status is
in the format specified in wait(2). Thus, the exit code of the command
will be WEXITSTATUS(status). In case /bin/sh could not be executed,
the exit status will be that of a command that does exit(127).
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...