X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=bwlimit.py;h=e3107628efb237b9c4dbaee1f39f9451e008f00a;hb=6aa8ca091b8a18f75d9256662a8df9b9875066d0;hp=7ac3def413634ab390cb8bd023643575a3afee92;hpb=28d1381822e9597f551ca085f4165384d75d4730;p=nodemanager.git diff --git a/bwlimit.py b/bwlimit.py index 7ac3def..e310762 100644 --- a/bwlimit.py +++ b/bwlimit.py @@ -594,18 +594,8 @@ def on(xid, dev = dev, share = None, minrate = None, maxrate = None, minexemptra # Setup a filter rule to the root class so each packet originated by a # container interface is classified to it corresponding class # The handle number is a mark created by ebtables with the xid - tc("filter replace dev %s parent 1:1 protocol ip prio 1 handle %d fw flowid 1:%x" % \ - (dev, default_minor | xid, default_minor | xid)) - - # Create the ebtables rule to mark the packets going out from the virtual - # interface to the actual device so the filter canmatch against the mark - # We remove and readd the rule because this method is called each time the - # bandwidth limit is changed - ebtables("-D INPUT -i veth%d -j mark --set-mark %d" % \ - (xid, default_minor | xid)) - ebtables("-A INPUT -i veth%d -j mark --set-mark %d" % \ - (xid, default_minor | xid)) - + tc("filter replace dev %s parent 1: protocol ip prio 1 handle %d fw flowid 1:%x" % \ + (dev, xid, default_minor | xid)) def set(xid, share = None, minrate = None, maxrate = None, minexemptrate = None, maxexemptrate = None, dev = dev ): on(xid = xid, dev = dev, share = share,