# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: bwlimit.py,v 1.13 2006/11/27 22:32:59 mlhuang Exp $
+# $Id: bwlimit.py,v 1.15 2007/02/07 04:21:11 mlhuang Exp $
#
import sys, os, re, getopt
# by root end up here and are capped at the node bandwidth
# cap.
on(root_xid, dev, share = root_share)
- file("/proc/sys/vnet/root_class", "w").write("%d" % ((1 << 16) | default_minor | root_xid))
+ try:
+ file("/proc/sys/vnet/root_class", "w").write("%d" % ((1 << 16) | default_minor | root_xid))
+ except:
+ pass
# Set up the default class. Packets that fail classification end
# up here.
minrate = bwmin
if minrate > maxrate:
minrate = maxrate
+ if maxexemptrate < bwmin:
+ maxexemptrate = bwmin
if maxexemptrate > bwmax:
maxexemptrate = bwmax
+ if minexemptrate < bwmin:
+ minexemptrate = bwmin
if minexemptrate > maxexemptrate:
minexemptrate = maxexemptrate