Sorry, was slow to notice your reply. I will benchmark this immediately. While I'm doing that I noticed...

- I'm using this *really* in the form "reenable iface", ie I really call "disable" + "enable" - It's used when a dynamic PPP connection (re)starts, eg a 3G PPP connection because the IP address changes on the interface. - I observe I'm currently "cheating" and I manually call the "undo_networking" script as this avoids a call into the firewall script, but this is obviously not terribly future proof or neat... - Would you be amenable to either adding a "force" flag or "re-enable" option which simply calls disable/enable?

Code for reenable would be at the bottom of firewall script, something like the following (untested for error handling):


    ....
    reenable)
        [ $# -eq 1 ] && exit 0
        shift
        [ $# -ne 1 ] && usage 2
        mutex_on
        if product_is_started; then
            detect_configuration
            disable_provider $1
            enable_provider $1
        fi
        mutex_off
        status=0
        ;;
    ....

Does this work for you?

Thanks

Ed W


On 25/04/2015 23:36, Tom Eastep wrote:
On 4/25/2015 9:16 AM, Tom Eastep wrote:
On 4/23/2015 11:55 AM, Ed W wrote:
Hi Tom

Would you be amenable to optimising detect_configuration for the special
case of calling "enable iface_x"?

...
My suggestion on practical ways to implement this would be for
'detect_config()' to take an optional interface parameter. Then each of
the stanzas can be wrapped in a conditional and only run if either the
param is empty or set to detect that specific interface.

My simple benchmarks suggest that slowest function for me is
'interface_is_usable', consuming about 1s. Then 'detect_gateway' which
consumes about 0.7s, the remainder is
'find_first_interface_address_if_any'. Note these benchmarks and
observations run against shorewall 4.6.6.1.

I'll take a look at this after I see what I can do about Laurens's bug.

Here is a lightly-tested patch against the current master branch.

-Tom


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to