1 diff -urN rc-scripts-0.4.12.orig/lib/ifdown rc-scripts-0.4.12/lib/ifdown
2 --- rc-scripts-0.4.12.orig/lib/ifdown 2014-06-10 06:55:19.000000000 +0000
3 +++ rc-scripts-0.4.12/lib/ifdown 2014-07-12 18:44:23.637000000 +0000
5 ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
7 LC_ALL=C ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
9 - if [ ${DEVICETYPE} = "bond" ]; then
10 - if [ ! -x /sbin/ifenslave ]; then
11 - nls "%s is missing. Can't continue." "/sbin/ifenslave"
15 - # get up the bonding device before enslaving
16 - if ! check_device_down "${DEVICE}"; then
17 - ip link set ${DEVICE} up
20 - for BSVAR in $(awk '/Slave Interface:/{ print $3}' /proc/net/bonding/${DEVICE}); do
21 - if [ "${BSVAR}" ]; then
22 - ifenslave -d ${DEVICE} $BSVAR
27 ip link set ${DEVICE} down
30 diff -urN rc-scripts-0.4.12.orig/lib/ifdown-bond rc-scripts-0.4.12/lib/ifdown-bond
31 --- rc-scripts-0.4.12.orig/lib/ifdown-bond 1970-01-01 00:00:00.000000000 +0000
32 +++ rc-scripts-0.4.12/lib/ifdown-bond 2014-07-12 22:00:34.509000000 +0000
36 +# ifdown-bond - bonding configuration script
37 +# Copyright (C) 2014 Marcin Krol <hawk@tld-linux.org>
39 +# This program is free software; you can redistribute it and/or modify
40 +# it under the terms of the GNU General Public License as published by
41 +# the Free Software Foundation; either version 2 of the License, or
42 +# (at your option) any later version.
44 +# This program is distributed in the hope that it will be useful,
45 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
46 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 +# GNU General Public License for more details.
49 +# You should have received a copy of the GNU General Public License
50 +# along with this program; if not, write to the Free Software
51 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
54 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
56 +. /etc/sysconfig/network
57 +. /etc/rc.d/init.d/functions
58 +. /lib/rc-scripts/functions.network
63 +if [ "x${2}" = "xboot" ] && is_no "${ONBOOT}"; then
67 +# set all major variables
70 +# forget all addresses
71 +LC_ALL=C ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
73 +# release slave devices
74 +for SLAVE_DEV in $(cat /sys/class/net/${DEVICE}/bonding/slaves); do
75 + echo "-${SLAVE_DEV}" > /sys/class/net/${DEVICE}/bonding/slaves
78 +# bring bonding master down
79 +ip link set ${DEVICE} down
81 +# remove bonding master
82 +if grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
83 + echo "-${DEVICE}" > /sys/class/net/bonding_masters
84 + if [ $? -ne 0 ]; then
88 diff -urN rc-scripts-0.4.12.orig/lib/ifup rc-scripts-0.4.12/lib/ifup
89 --- rc-scripts-0.4.12.orig/lib/ifup 2014-06-10 06:55:19.000000000 +0000
90 +++ rc-scripts-0.4.12/lib/ifup 2014-07-12 21:58:42.147000000 +0000
95 -if is_yes "$SLAVE" && [ ! -x /sbin/ifenslave ]; then
96 - nls "%s is missing. Can't continue." "/sbin/ifenslave"
100 -if is_yes "$SLAVE" && [ -n "$MASTER" -a -x /sbin/ifenslave ]; then
101 - RFLAG="" && is_yes "${RECIEVE-ONLY}" && RFLAG="-r"
103 - ip link set ${DEVICE} down
104 - nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
105 - ifenslave $RFLAG "$MASTER" "$DEVICE"
107 +if is_yes "$SLAVE" && [ -n "$MASTER" ]; then
108 + if ! grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null; then
109 + nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
110 + ip link set dev ${DEVICE} down
111 + echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
113 if [ -n "$ETHTOOL_OPTS" ] ; then
114 /sbin/ethtool -s $DEVICE $ETHTOOL_OPTS
116 diff -urN rc-scripts-0.4.12.orig/lib/ifup-bond rc-scripts-0.4.12/lib/ifup-bond
117 --- rc-scripts-0.4.12.orig/lib/ifup-bond 1970-01-01 00:00:00.000000000 +0000
118 +++ rc-scripts-0.4.12/lib/ifup-bond 2014-07-12 22:08:02.953000000 +0000
122 +# ifup-bond - bonding configuration script
123 +# Copyright (C) 2014 Marcin Krol <hawk@tld-linux.org>
125 +# This program is free software; you can redistribute it and/or modify
126 +# it under the terms of the GNU General Public License as published by
127 +# the Free Software Foundation; either version 2 of the License, or
128 +# (at your option) any later version.
130 +# This program is distributed in the hope that it will be useful,
131 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
132 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
133 +# GNU General Public License for more details.
135 +# You should have received a copy of the GNU General Public License
136 +# along with this program; if not, write to the Free Software
137 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
140 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
142 +. /etc/sysconfig/network
143 +. /etc/rc.d/init.d/functions
144 +. /lib/rc-scripts/functions.network
149 +if [ "x${2}" = "xboot" ] && is_no "${ONBOOT}"; then
153 +# check for bonding support
154 +if [ ! -f /sys/class/net/bonding_masters ]; then
155 + modprobe -s bonding || exit 1
156 + # delete default bond0
157 + echo "-bond0" > /sys/class/net/bonding_masters
160 +# set all major variables
163 +# create bonding master
164 +if ! grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
165 + echo "+${DEVICE}" > /sys/class/net/bonding_masters
166 + if [ $? -eq 0 ]; then
167 + ip link set dev ${DEVICE} multicast ${MULTICAST} ${ARP}
173 +# add the bits to setup driver parameters here
174 +# taken from Fedora initscripts
175 +for arg in ${BONDING_OPTS} ; do
178 + if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then
181 + for arp_ip in $value; do
182 + if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then
183 + echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key
187 + elif [ "${key}" = "arp_ip_target" ]; then
188 + if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
189 + echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
191 + elif [ "${key}" != "primary" ]; then
192 + echo $value > /sys/class/net/${DEVICE}/bonding/$key
195 diff -urN rc-scripts-0.4.12.orig/lib/Makefile.am rc-scripts-0.4.12/lib/Makefile.am
196 --- rc-scripts-0.4.12.orig/lib/Makefile.am 2013-11-02 20:50:20.000000000 +0000
197 +++ rc-scripts-0.4.12/lib/Makefile.am 2014-07-12 22:01:57.571000000 +0000
199 scriptsdir = @exec_prefix@/lib/$(PACKAGE)
214 diff -urN rc-scripts-0.4.12.orig/lib/Makefile.in rc-scripts-0.4.12/lib/Makefile.in
215 --- rc-scripts-0.4.12.orig/lib/Makefile.in 2014-07-12 11:45:17.000000000 +0000
216 +++ rc-scripts-0.4.12/lib/Makefile.in 2014-07-12 22:01:50.605000000 +0000
218 #scriptsdir = @networkscriptsdir@
219 scriptsdir = @exec_prefix@/lib/$(PACKAGE)