1 diff -uNr rc-scripts-0.3.1.orig/sysconfig/network-scripts/ifdown-post rc-scripts-0.3.1/sysconfig/network-scripts/ifdown-post
2 --- rc-scripts-0.3.1.orig/sysconfig/network-scripts/ifdown-post Tue May 15 18:06:00 2001
3 +++ rc-scripts-0.3.1/sysconfig/network-scripts/ifdown-post Wed Feb 11 13:40:29 2004
10 # This should be called whenever an interface goes down, not just when
11 # it is brought down explicitly.
14 get_ppp_device_and_pid
16 -# Delete root queueing discipline
17 -if [ -n "$QDISC" ]; then
18 - tc qdisc del dev "$REALDEVICE" root $QDISC
19 +# (QoS) Delete root queueing discipline
20 +if [ -n "${BANDWIDTH_OUT}" ]; then
21 + if [ "${QDISC_CLASS}" = "htb" -o "${QDISC_CLASS}" = "cbq" ]; then
22 + tc qdisc del dev ${REALDEVICE} root
23 + elif [ -z "${QDISC}" -o "${QDISC}" = "tbf" ]; then
24 + tc qdisc del dev ${REALDEVICE} root
25 + elif [ -n "${QDISC}" ]; then
26 + tc qdisc del dev ${REALDEVICE} root
29 + if [ -n "${QDISC}" ]; then
30 + tc qdisc add dev ${REALDEVICE} root
34 +if [ -n "${BANDWIDTH_IN}" ]; then
35 + tc qdisc del dev ${REALDEVICE} ingress
38 # execute run_down() function (if available in device configuration file)
39 diff -uNr rc-scripts-0.3.1.orig/sysconfig/network-scripts/ifup-post rc-scripts-0.3.1/sysconfig/network-scripts/ifup-post
40 --- rc-scripts-0.3.1.orig/sysconfig/network-scripts/ifup-post Wed Feb 11 13:38:21 2004
41 +++ rc-scripts-0.3.1/sysconfig/network-scripts/ifup-post Wed Feb 11 13:40:29 2004
52 get_ppp_device_and_pid
54 -if [ -n "$QDISC" ]; then
55 -# Set the queuing discipline
56 -# eg: sfq for better link sharing or teql0 for link equalizer
57 - tc qdisc add dev "$REALDEVICE" root $QDISC
58 +# Simple QoS support (bandwidth limit)
59 +if [ -n "${BANDWIDTH_OUT}" ]; then
60 + if [ "${QDISC_CLASS}" = "htb" -o "${QDISC_CLASS}" = "cbq" ]; then
61 + case "${QDISC_CLASS}" in
63 + tc qdisc add dev ${REALDEVICE} root handle 1: htb default 10
64 + tc class add dev ${REALDEVICE} parent 1: classid 1:10 htb rate ${BANDWIDTH_OUT}kbit ceil ${BANDWIDTH_OUT}kbit
65 + [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
68 + # FIXME: hardcoded ethernet speed (bandwidth)
69 + tc qdisc add dev ${REALDEVICE} root handle 1: cbq bandwidth 100000kbit cell 8 avpkt 1000 mpu 64
70 + tc class add dev ${REALDEVICE} parent 1: classid 1:10 cbq bandwidth 100000kbit rate ${BANDWIDTH_OUT}kbit maxburst 5 avpkt 1000 allot 1514 bounded
71 + [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
72 + tc filter add dev ${REALDEVICE} protocol ip parent 1: u32 match ip src 0.0.0.0/0 flowid 1:10
75 + elif [ -z "${QDISC}" -o "${QDISC}" = "tbf" ]; then
76 + tc qdisc add dev ${REALDEVICE} root tbf rate ${BANDWIDTH_OUT}kbit latency 50ms burst 51200
77 + elif [ -n "${QDISC}" ]; then
78 + tc qdisc add dev ${REALDEVICE} root ${QDISC}
81 + if [ -n "${QDISC}" ]; then
82 + tc qdisc add dev ${REALDEVICE} root ${QDISC}
86 +if [ -n "${BANDWIDTH_IN}" ]; then
87 + tc qdisc add dev ${REALDEVICE} handle ffff: ingress
88 + tc filter add dev ${REALDEVICE} parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${BANDWIDTH_IN}kbit burst 10k drop flowid :3
91 /etc/sysconfig/network-scripts/ifup-aliases ${CONFIG}