#18327: iptables problem with musl
---------------------------+------------------------
 Reporter:  barbaracus@…   |      Owner:  developers
     Type:  defect         |     Status:  new
 Priority:  normal         |  Milestone:
Component:  packages       |    Version:  Trunk
 Keywords:  iptables musl  |
---------------------------+------------------------
 Hello,

 I've been trying to compile openwrt against musl, instead of uclibc.
 Everything compiles fine and the build system makes the images. I'm using
 the latest trunk.

 Unfortunately I have a problem with iptables: it seems it doesn't
 understand the negation option "!" anymore.

 I tracked this down to the way musl implements getopt: it stops processing
 the options as soon as it finds a non-option argument.

 Therefore this rule:

 iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP

 doesn't work anymore: the options processing stops at the '!' and then
 iptables bails out with this error:

 iptables v1.4.21: unknown arguments found on commandline

 The uclibc's getopt supports permutations and in that case, when the
 optstring begins with '-', it returns 1 in case of a non-option argument:
 this allows iptables to parse the exclamation mark. (see
 iptables/iptables.c:1680).

 Is there a faster way to solve the problem other than adding a proper
 option to negate the rule, like -^ for example, I can't think of anything
 better which doesn't clash with other options. It would be non standard
 however.

 Also wrapping the getopt() calls in iptables in a helper function, say
 xgetopt(), which takes care of the quotation mark could be an idea.

--
Ticket URL: <https://dev.openwrt.org/ticket/18327>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to