aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 6b0ed084a5271798104391dccb00a738979dd3fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth20
-rw-r--r--sysconfig/network-scripts/network-functions16
2 files changed, 20 insertions, 16 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index f46a8843..e4c65aa0 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -99,9 +99,7 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then
/sbin/ip link set dev ${DEVICE} down
echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
}
- if [ -n "$ETHTOOL_OPTS" ] ; then
- /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
- fi
+ ethtool_set
exit 0
fi
@@ -158,9 +156,7 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
fi
/sbin/ip addr flush dev ${DEVICE} 2>/dev/null
/sbin/ip link set dev ${DEVICE} up
- if [ -n "$ETHTOOL_OPTS" ] ; then
- /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
- fi
+ ethtool_set
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
/usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
# Upon adding a device to a bridge,
@@ -199,9 +195,7 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
exit 1
fi
- if [ -n "$ETHTOOL_OPTS" ] ; then
- /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
- fi
+ ethtool_set
if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
@@ -214,9 +208,7 @@ else
if [ -z "${IPADDR}" -a -z "${IPADDR0}" -a -z "${IPADDR1}" -a -z "${IPADDR2}" ]; then
# enable device without IP, useful for e.g. PPPoE
ip link set dev ${REALDEVICE} up
- if [ -n "$ETHTOOL_OPTS" ] ; then
- /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
- fi
+ ethtool_set
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
else
@@ -230,9 +222,7 @@ else
exit 1
fi
- if [ -n "$ETHTOOL_OPTS" ] ; then
- /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
- fi
+ ethtool_set
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 2d3263a2..f6d2f05b 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -153,7 +153,21 @@ source_config ()
fi
}
-
+ethtool_set()
+{
+ oldifs=$IFS;
+ IFS=';';
+ for opts in $ETHTOOL_OPTS ; do
+ IFS=$oldifs;
+ if [[ "${opts}" =~ [[:space:]]*- ]]; then
+ /sbin/ethtool $opts
+ else
+ /sbin/ethtool -s ${REALDEVICE} $opts
+ fi
+ IFS=';';
+ done
+ IFS=$oldifs;
+}
expand_config ()
{