Hi Jukka, On 07/27/2015 05:03 PM, Jukka Rissanen wrote: > On ma, 2015-07-27 at 14:47 +0200, Daniel Wagner wrote: >> We like to add and remove rules while the filewall is up and running. > > filewall -> firewall
fixed as well :) > __connman_firewall_remove_rule() and __connman_firewall_enable_rule() > and __connman_firewall_disable_rule() are looking quite similar, perhaps > some refactoring could be done here? I'll see what I can do. In this patch I moved the common part from __connman_firewall_{enable,disable} and __connman_firewall_{enable,disable}_rule to firewall_{enable,disable}_rule. What is left at this point is that *_rule() handle just one rule without a cleaning up if something goes wrong. Hmm, maybe adding a bool to the rule struct and remember if it is enabled/installed or not would also make it a bit simpler to handle in the error case. cheers, daniel _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman