1 diff -urNp rc-scripts-0.4.13.orig/lib/ifdown rc-scripts-0.4.13/lib/ifdown
2 --- rc-scripts-0.4.13.orig/lib/ifdown 2015-01-22 16:01:18.000000000 +0000
3 +++ rc-scripts-0.4.13/lib/ifdown 2015-02-06 13:44:37.910314244 +0000
4 @@ -118,11 +118,6 @@ if [ -n "${SUBDEVICE}" ]; then
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 is_yes "$SLAVE"; then
10 - ip link set ${DEVICE} nomaster
13 ip link set ${DEVICE} down
16 diff -urNp rc-scripts-0.4.13.orig/lib/ifdown-bond rc-scripts-0.4.13/lib/ifdown-bond
17 --- rc-scripts-0.4.13.orig/lib/ifdown-bond 1970-01-01 00:00:00.000000000 +0000
18 +++ rc-scripts-0.4.13/lib/ifdown-bond 2015-02-06 13:42:15.348314244 +0000
22 +# ifdown-bond - bonding configuration script
23 +# Copyright (C) 2014 Marcin Krol <hawk@tld-linux.org>
25 +# This program is free software; you can redistribute it and/or modify
26 +# it under the terms of the GNU General Public License as published by
27 +# the Free Software Foundation; either version 2 of the License, or
28 +# (at your option) any later version.
30 +# This program is distributed in the hope that it will be useful,
31 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
32 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 +# GNU General Public License for more details.
35 +# You should have received a copy of the GNU General Public License
36 +# along with this program; if not, write to the Free Software
37 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
42 +. /etc/sysconfig/network
43 +. /etc/rc.d/init.d/functions
44 +. /lib/rc-scripts/functions.network
49 +if [ "x${2}" = "xboot" ] && is_no "${ONBOOT}"; then
53 +# set all major variables
56 +# forget all addresses
57 +LC_ALL=C ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
59 +# release slave devices
60 +for SLAVE_DEV in $(cat /sys/class/net/${DEVICE}/bonding/slaves); do
61 + echo "-${SLAVE_DEV}" > /sys/class/net/${DEVICE}/bonding/slaves
64 +# bring bonding master down
65 +ip link set ${DEVICE} down
67 +# remove bonding master
68 +if grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
69 + echo "-${DEVICE}" > /sys/class/net/bonding_masters
70 + if [ $? -ne 0 ]; then
74 diff -urNp rc-scripts-0.4.13.orig/lib/ifup rc-scripts-0.4.13/lib/ifup
75 --- rc-scripts-0.4.13.orig/lib/ifup 2015-01-22 16:01:18.000000000 +0000
76 +++ rc-scripts-0.4.13/lib/ifup 2015-02-06 13:51:40.208314244 +0000
77 @@ -120,11 +120,12 @@ if [ -n "$ETHTOOL_OPTS" ] ; then
80 if is_yes "$SLAVE" && [ -n "$MASTER" ] ; then
81 - nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
82 - ip link set "$DEVICE" master "$MASTER"
83 - ip link set "$DEVICE" up
86 + if ! grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null; then
87 + nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
88 + ip link set dev ${DEVICE} down
89 + echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
94 if [ "$HANDLING" = "2" ]; then
95 diff -urNp rc-scripts-0.4.13.orig/lib/ifup-bond rc-scripts-0.4.13/lib/ifup-bond
96 --- rc-scripts-0.4.13.orig/lib/ifup-bond 1970-01-01 00:00:00.000000000 +0000
97 +++ rc-scripts-0.4.13/lib/ifup-bond 2015-02-06 13:42:15.349314244 +0000
101 +# ifup-bond - bonding configuration script
102 +# Copyright (C) 2014 Marcin Krol <hawk@tld-linux.org>
104 +# This program is free software; you can redistribute it and/or modify
105 +# it under the terms of the GNU General Public License as published by
106 +# the Free Software Foundation; either version 2 of the License, or
107 +# (at your option) any later version.
109 +# This program is distributed in the hope that it will be useful,
110 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
111 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112 +# GNU General Public License for more details.
114 +# You should have received a copy of the GNU General Public License
115 +# along with this program; if not, write to the Free Software
116 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
119 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
121 +. /etc/sysconfig/network
122 +. /etc/rc.d/init.d/functions
123 +. /lib/rc-scripts/functions.network
128 +if [ "x${2}" = "xboot" ] && is_no "${ONBOOT}"; then
132 +# check for bonding support
133 +if [ ! -f /sys/class/net/bonding_masters ]; then
134 + modprobe -s bonding || exit 1
135 + # delete default bond0
136 + echo "-bond0" > /sys/class/net/bonding_masters
139 +# set all major variables
142 +# create bonding master
143 +if ! grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
144 + echo "+${DEVICE}" > /sys/class/net/bonding_masters
145 + if [ $? -eq 0 ]; then
146 + ip link set dev ${DEVICE} multicast ${MULTICAST} ${ARP}
152 +# add the bits to setup driver parameters here
153 +# taken from Fedora initscripts
154 +for arg in ${BONDING_OPTS} ; do
157 + if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then
160 + for arp_ip in $value; do
161 + if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then
162 + echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key
166 + elif [ "${key}" = "arp_ip_target" ]; then
167 + if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
168 + echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
170 + elif [ "${key}" != "primary" ]; then
171 + echo $value > /sys/class/net/${DEVICE}/bonding/$key
174 diff -urNp rc-scripts-0.4.13.orig/lib/Makefile.am rc-scripts-0.4.13/lib/Makefile.am
175 --- rc-scripts-0.4.13.orig/lib/Makefile.am 2013-11-02 20:50:20.000000000 +0000
176 +++ rc-scripts-0.4.13/lib/Makefile.am 2015-02-06 13:42:15.349314244 +0000
177 @@ -10,6 +10,7 @@ sbin_SCRIPTS = \
178 scriptsdir = @exec_prefix@/lib/$(PACKAGE)
185 @@ -17,6 +18,7 @@ scripts_SCRIPTS = \
193 diff -urNp rc-scripts-0.4.13.orig/lib/Makefile.in rc-scripts-0.4.13/lib/Makefile.in
194 --- rc-scripts-0.4.13.orig/lib/Makefile.in 2015-01-22 16:02:57.000000000 +0000
195 +++ rc-scripts-0.4.13/lib/Makefile.in 2015-02-06 13:42:15.350314244 +0000
196 @@ -256,6 +256,7 @@ sbin_SCRIPTS = \
197 #scriptsdir = @networkscriptsdir@
198 scriptsdir = @exec_prefix@/lib/$(PACKAGE)
204 @@ -263,6 +264,7 @@ scripts_SCRIPTS = \