Merge ~mkukri/ubuntu/+source/ifupdown:merge into ubuntu/+source/ifupdown:ubuntu/devel
- Git
- lp:~mkukri/ubuntu/+source/ifupdown
- merge
- Merge into ubuntu/devel
Status: | Superseded |
---|---|
Proposed branch: | ~mkukri/ubuntu/+source/ifupdown:merge |
Merge into: | ubuntu/+source/ifupdown:ubuntu/devel |
Diff against target: |
2009 lines (+653/-240) (has conflicts) 45 files modified
archcommon.c (+47/-1) archcommon.h (+1/-0) can.defn (+3/-1) debian/changelog (+95/-0) debian/control (+2/-2) debian/copyright (+3/-2) debian/gbp.conf (+2/-0) debian/ifupdown-hotplug (+9/-8) debian/ifupdown-rfkill (+23/-0) debian/ifupdown-rfkill.rules (+3/-0) debian/ifupdown.maintscript (+0/-7) debian/networking.init (+5/-5) debian/networking.service (+3/-2) debian/tests/control (+1/-1) debian/tests/hotplug (+60/-5) examples/ping-places.sh (+3/-3) ifup.8 (+1/-1) inet.defn (+77/-67) inet6.defn (+99/-31) interfaces.5.pre (+2/-6) link.defn (+10/-8) main.c (+5/-5) tests/kfreebsd/down.1 (+1/-1) tests/kfreebsd/down.2 (+6/-6) tests/kfreebsd/down.3 (+4/-4) tests/kfreebsd/down.4 (+1/-1) tests/kfreebsd/down.5 (+1/-1) tests/kfreebsd/down.6 (+1/-1) tests/kfreebsd/up.1 (+1/-1) tests/kfreebsd/up.2 (+6/-6) tests/kfreebsd/up.3 (+3/-3) tests/kfreebsd/up.4 (+1/-1) tests/kfreebsd/up.5 (+2/-2) tests/kfreebsd/up.6 (+2/-2) tests/linux/down.19 (+28/-0) tests/linux/down.7 (+6/-6) tests/linux/down.8 (+1/-1) tests/linux/testcase.19 (+43/-0) tests/linux/up.16 (+6/-6) tests/linux/up.19 (+43/-0) tests/linux/up.3 (+18/-18) tests/linux/up.7 (+15/-15) tests/linux/up.9 (+1/-1) tests/testbuild-linux (+1/-1) wait-online.sh (+8/-8) Conflict in debian/changelog Conflict in inet.defn Conflict in inet6.defn |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Sponsors | Pending | ||
Review via email: mp+460519@code.launchpad.net |
This proposal has been superseded by a proposal from 2024-02-15.
Commit message
Merge ifupdown with Debian Sid.
PPA testbuild: https:/
PPA autopkgtest: https:/
Description of the change
Unmerged commits
- eab972a... by Mate Kukri
-
changelog
- 821e2c1... by Mate Kukri
-
update-maintainer
- 2996209... by Mate Kukri
-
reconstruct-
changelog - 1ce7d8f... by Mate Kukri
-
merge-changelogs
- fff3a64... by Mate Kukri
-
* Fix if-up.d/resolved hook to properly work with nameservers and search
domains (LP: #1981103) - e4c845a... by Mate Kukri
-
- ifup@.service, ifupdown-hotplug: Additionally run for "auto" class. We
don't really support "allow-hotplug" in Ubuntu at the moment, so we need
to deal with "auto" devices appearing after the "networking" init script
already ran. - 0102833... by Mate Kukri
-
- Always call dhclient with -1, Ubuntu carries a patch so that renewal
won't time out. - f612bcf... by Santiago Ruano Rincon
-
0.8.41 (patches unapplied)
Imported using git-ubuntu import.
- aa37842... by Santiago Ruano Rincon
-
0.8.40 (patches unapplied)
Imported using git-ubuntu import.
- ced6b41... by Santiago Ruano Rincon
-
0.8.39 (patches unapplied)
Imported using git-ubuntu import.
Preview Diff
1 | diff --git a/archcommon.c b/archcommon.c |
2 | index 52a2666..32c541f 100644 |
3 | --- a/archcommon.c |
4 | +++ b/archcommon.c |
5 | @@ -23,7 +23,7 @@ bool _iface_has(const char *iface, const char *delims) { |
6 | return (token != NULL); |
7 | } |
8 | |
9 | -bool execable(const char *program) { |
10 | +static bool file_is_exec(const char *program) { |
11 | struct stat buf; |
12 | |
13 | if (0 == stat(program, &buf)) |
14 | @@ -33,6 +33,52 @@ bool execable(const char *program) { |
15 | return false; |
16 | } |
17 | |
18 | +bool execable(const char *program) { |
19 | + char *filename = NULL; |
20 | + const char *path_list; |
21 | + const char *path, *path_end; |
22 | + size_t path_len; |
23 | + |
24 | + if (program[0] == '/') |
25 | + return file_is_exec(program); |
26 | + |
27 | + path_list = getenv("PATH"); |
28 | + if (!path_list) |
29 | + return false; |
30 | + |
31 | + /* |
32 | + * We allocate based on the length of PATH and the program name we |
33 | + * are looking for (plus one byte for the terminating NUL, and a |
34 | + * potential "/"), as we take PATH apart into pieces and thus the |
35 | + * resulting length cannot be greater than that. This avoids having |
36 | + * to realloc() within the loop. |
37 | + */ |
38 | + filename = malloc(strlen(path_list) + strlen(program) + 2); |
39 | + if (!filename) |
40 | + err(1, "malloc"); |
41 | + |
42 | + for (path = path_list; path; path = path_end ? path_end + 1 : NULL) { |
43 | + path_end = strchr(path, ':'); |
44 | + path_len = path_end ? (size_t)(path_end - path) : strlen(path); |
45 | + |
46 | + filename[0] = '\0'; |
47 | + strncat(filename, path, path_len); |
48 | + if (path_len) |
49 | + strcat(filename + path_len, "/"); |
50 | + /* Append at the end regardless of whether we have added a |
51 | + * trailing "/". */ |
52 | + strcat(filename + path_len, program); |
53 | + |
54 | + if (file_is_exec(filename)) { |
55 | + free(filename); |
56 | + return true; |
57 | + } |
58 | + } |
59 | + |
60 | + free(filename); |
61 | + return false; |
62 | +} |
63 | + |
64 | void cleanup_hwaddress(interface_defn *ifd, char **pparam, int argc, char **argv) { |
65 | /* replace "random" with a random MAC address */ |
66 | if (strcmp(*pparam, "random") == 0) { |
67 | diff --git a/archcommon.h b/archcommon.h |
68 | index fe99950..818b0b6 100644 |
69 | --- a/archcommon.h |
70 | +++ b/archcommon.h |
71 | @@ -5,6 +5,7 @@ bool execable(const char *); |
72 | #define iface_is_link() (!_iface_has(ifd->real_iface, ":.")) |
73 | #define iface_has(s) _iface_has(ifd->real_iface, (s)) |
74 | #define iface_is_lo() ((!strcmp(ifd->logical_iface, LO_IFACE)) && (!no_loopback)) |
75 | +#define var_strcasecmp(name, value) (strcasecmp(value, get_var(name, strlen(name), ifd))) |
76 | |
77 | bool _iface_has(const char *, const char *); |
78 | void cleanup_hwaddress(interface_defn *ifd, char **pparam, int argc, char **argv); |
79 | diff --git a/can.defn b/can.defn |
80 | index 65e79e6..c246f07 100644 |
81 | --- a/can.defn |
82 | +++ b/can.defn |
83 | @@ -13,7 +13,8 @@ method static |
84 | listenonly listenonly -- listen only mode (on|off) |
85 | triple triple -- activate triple sampling (on|off) |
86 | oneshot oneshot -- one shot mode (on|off) |
87 | - berr berr -- activate berr reporting (on|off) |
88 | + berr berr -- activate berr reporting (on|off) |
89 | + restart-ms restart-ms -- restart-ms (0..) |
90 | |
91 | up |
92 | ip link set %iface% type can bitrate %bitrate% |
93 | @@ -22,6 +23,7 @@ method static |
94 | [[ ip link set %iface% type can triple-sampling %triple% ]] |
95 | [[ ip link set %iface% type can one-shot %oneshot% ]] |
96 | [[ ip link set %iface% type can berr-reporting %berr% ]] |
97 | + [[ ip link set %iface% type can restart-ms %restart-ms% ]] |
98 | ip link set %iface% up |
99 | |
100 | down |
101 | diff --git a/debian/changelog b/debian/changelog |
102 | index 6c83251..c017763 100644 |
103 | --- a/debian/changelog |
104 | +++ b/debian/changelog |
105 | @@ -1,3 +1,98 @@ |
106 | +<<<<<<< debian/changelog |
107 | +======= |
108 | +ifupdown (0.8.41ubuntu1) noble; urgency=medium |
109 | + |
110 | + * Merge with Debian unstable. Remaining changes: |
111 | + - Always call dhclient with -1, Ubuntu carries a patch so that renewal |
112 | + won't time out. |
113 | + - ifup@.service, ifupdown-hotplug: Additionally run for "auto" class. We |
114 | + don't really support "allow-hotplug" in Ubuntu at the moment, so we need |
115 | + to deal with "auto" devices appearing after the "networking" init script |
116 | + already ran. |
117 | + - Fix if-up.d/resolved hook to properly work with nameservers and search |
118 | + domains (LP: 1981103) |
119 | + * Changes now included in Debian: |
120 | + - Ship resolved integration scripts. |
121 | + |
122 | + -- Mate Kukri <mate.kukri@canonical.com> Wed, 14 Feb 2024 14:14:08 +0000 |
123 | + |
124 | +ifupdown (0.8.41) unstable; urgency=high |
125 | + |
126 | + * networking.service: Improve how to handle hotplug devices. Thanks to kibi, |
127 | + Oleg A. Arkhangelsky <sysoleg@yandex.ru>, et al. |
128 | + (Closes: #1022843, #1029449) |
129 | + * d/tests/hotplug: add more tests, including unplugged dummy interface |
130 | + |
131 | + -- Santiago Ruano Rincón <santiago@debian.org> Tue, 24 Jan 2023 14:07:32 +0100 |
132 | + |
133 | +ifupdown (0.8.40) unstable; urgency=medium |
134 | + |
135 | + [ Colin Watson ] |
136 | + * Clarify formatting of post-up and pre-down aliases in interfaces(5). |
137 | + |
138 | + [ Vincent Bernat ] |
139 | + * Kill dhclient on down for inet6 auto method. (Closes: #1000180) |
140 | + |
141 | + [ Santiago Ruano Rincón ] |
142 | + * networking.service: Wants ifupdown-pre.service instead of Requiring it. |
143 | + Patch by Ron <ron@debian.org> |
144 | + (Closes: #998088) |
145 | + * networking.service: Add ExecStart=/sbin/ifup -a --allow=hotplug. Patch by |
146 | + "Oleg A. Arkhangelsky" <sysoleg@yandex.ru> |
147 | + (Closes: #1022843) |
148 | + * Update d/copyright and fix Source URL |
149 | + |
150 | + [ Marek Vasut ] |
151 | + * Add short -f option for --force long option |
152 | + |
153 | + [ Simon Arlott ] |
154 | + * Support IPv6 tunnels (ip6ip6 and ip6gre) |
155 | + * Support encaplimit on IPv6 tunnels |
156 | + * Document and test support for ipip6 tunnels too (IPv4 in IPv6) |
157 | + |
158 | + [ Guillem Jover ] |
159 | + * Rework execable() function to accept a filename instead of a pathname |
160 | + * Do not use absolute pathnames when executing commands |
161 | + |
162 | + -- Santiago Ruano Rincón <santiago@debian.org> Mon, 16 Jan 2023 14:57:59 +0100 |
163 | + |
164 | +ifupdown (0.8.39) unstable; urgency=low |
165 | + |
166 | + * Add execution permission on resolved scripts. Thanks to Vincent Lefèvre |
167 | + (Closes: #1021259) |
168 | + |
169 | + -- Santiago Ruano Rincón <santiago@debian.org> Tue, 04 Oct 2022 17:24:23 +0200 |
170 | + |
171 | +ifupdown (0.8.38) unstable; urgency=low |
172 | + |
173 | + [ Johannes Schauer Marin Rodrigues ] |
174 | + * Remove dependency on lsb-base (Closes: #1020604) |
175 | + |
176 | + [ Santiago Ruano Rincón ] |
177 | + * Remove pump support (no longer in Debian archive) |
178 | + * Fix error message when turning down VLAN interfaces. Thanks to Aleksandr |
179 | + Muravjov (Closes: #1007889) |
180 | + * Ship Ubuntu's integration scripts for systemd-resolved. Thanks to Luca |
181 | + Boccassi (Closes: #1016798) |
182 | + * Add rfkill support. Thanks to Sebastian Reichel <sre@debian.org> |
183 | + (Closes: #645559) |
184 | + |
185 | + -- Santiago Ruano Rincón <santiago@debian.org> Mon, 03 Oct 2022 16:24:38 +0200 |
186 | + |
187 | +ifupdown (0.8.37) unstable; urgency=low |
188 | + |
189 | + * Add debian/gbp.conf |
190 | + * Acknowledge 0.8.36+nmu1. |
191 | + * Add timeout for IPv6 stateless dhcp. Thanks to Joerg Dorchain <joerg@dorchain.net> |
192 | + (Closes: #947234) |
193 | + * Correctly copy (duplicate) the interface to exclude with --read-environment. Thanks to Adam Stephens <adam.stephens@gmail.com> |
194 | + (Closes: #994745) |
195 | + * Include restart-ms option in can config. Thanks to Joerg Dorchain <joerg@dorchain.net> |
196 | + (Closes: #947233) |
197 | + |
198 | + -- Santiago Ruano Rincón <santiago@debian.org> Wed, 19 Jan 2022 20:55:17 +0100 |
199 | + |
200 | +>>>>>>> debian/changelog |
201 | ifupdown (0.8.36+nmu1ubuntu5) mantic; urgency=medium |
202 | |
203 | [ Uwe Kleine-König ] |
204 | diff --git a/debian/control b/debian/control |
205 | index c16a114..d674cd3 100644 |
206 | --- a/debian/control |
207 | +++ b/debian/control |
208 | @@ -4,7 +4,7 @@ Priority: important |
209 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
210 | XSBC-Original-Maintainer: Josué Ortega <josue@debian.org> |
211 | Uploaders: Santiago Ruano Rincón <santiago@debian.org> |
212 | -Standards-Version: 4.5.0 |
213 | +Standards-Version: 4.6.1 |
214 | Build-Depends: debhelper-compat (= 13) |
215 | Vcs-Git: https://salsa.debian.org/debian/ifupdown.git |
216 | Vcs-Browser: https://salsa.debian.org/debian/ifupdown |
217 | @@ -13,7 +13,7 @@ Rules-Requires-Root: no |
218 | Package: ifupdown |
219 | Architecture: any |
220 | Depends: ${net:Depends}, ${shlibs:Depends}, ${misc:Depends}, |
221 | - lsb-base, adduser, |
222 | + adduser, |
223 | iproute2 [linux-any], freebsd-net-tools [kfreebsd-any], inetutils-tools [hurd-any] |
224 | Recommends: isc-dhcp-client | dhcp-client |
225 | Suggests: ppp, rdnssd, ${net:Suggests} |
226 | diff --git a/debian/copyright b/debian/copyright |
227 | index c3348a4..3b9b419 100644 |
228 | --- a/debian/copyright |
229 | +++ b/debian/copyright |
230 | @@ -1,11 +1,12 @@ |
231 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
232 | Upstream-Name: ifupdown |
233 | -Source: https://anonscm.debian.org/cgit/collab-maint/ifupdown.git |
234 | +Source: https://salsa.debian.org/debian/ifupdown/ |
235 | |
236 | Files: * |
237 | Copyright: 1999-2009 Anthony Towns |
238 | 2010-2015 Andrew Shadura |
239 | - 2015 Guus Sliepen |
240 | + 2015 Guus Sliepen |
241 | + 2020-2022 Josué Ortega, Santiago Ruano Rincón |
242 | License: GPL-2+ |
243 | This program is free software; you can redistribute it |
244 | and/or modify it under the terms of the GNU General Public |
245 | diff --git a/debian/gbp.conf b/debian/gbp.conf |
246 | new file mode 100644 |
247 | index 0000000..1f5a11d |
248 | --- /dev/null |
249 | +++ b/debian/gbp.conf |
250 | @@ -0,0 +1,2 @@ |
251 | +[DEFAULT] |
252 | +debian-tag = %(version)s |
253 | diff --git a/debian/ifupdown-hotplug b/debian/ifupdown-hotplug |
254 | index effdec9..a1e39a7 100755 |
255 | --- a/debian/ifupdown-hotplug |
256 | +++ b/debian/ifupdown-hotplug |
257 | @@ -5,10 +5,8 @@ |
258 | |
259 | PATH='/sbin:/bin:/usr/sbin:/usr/bin' |
260 | |
261 | -if [ -x /usr/bin/logger ]; then |
262 | - LOGGER=/usr/bin/logger |
263 | -elif [ -x /bin/logger ]; then |
264 | - LOGGER=/bin/logger |
265 | +if [ -x "$(command -v logger)" ]; then |
266 | + LOGGER=logger |
267 | else |
268 | unset LOGGER |
269 | fi |
270 | @@ -35,7 +33,7 @@ if [ -z "$INTERFACE" ]; then |
271 | fi |
272 | |
273 | check_program() { |
274 | - [ -x $1 ] && return 0 |
275 | + [ -x "$(command -v $1)" ] && return 0 |
276 | |
277 | mesg "ERROR: $1 not found. You need to install the ifupdown package." |
278 | mesg "ifupdown udev helper $ACTION event for $INTERFACE not handled." |
279 | @@ -56,10 +54,13 @@ wait_for_interface() { |
280 | } |
281 | |
282 | net_ifup() { |
283 | - check_program /sbin/ifup |
284 | + check_program ifup |
285 | |
286 | # exit if the interface is not configured as allow-hotplug |
287 | - TARGET_IFACE=$(/sbin/ifquery --allow hotplug -l "$INTERFACE" || true) |
288 | + TARGET_IFACE=$(ifquery --allow hotplug -l "$INTERFACE" || true) |
289 | + if [ -z "$TARGET_IFACE" ]; then |
290 | + TARGET_IFACE=$(/sbin/ifquery --allow auto -l "$INTERFACE" || true) |
291 | + fi |
292 | if [ -z "$TARGET_IFACE" ]; then |
293 | TARGET_IFACE=$(/sbin/ifquery --allow auto -l "$INTERFACE" || true) |
294 | fi |
295 | @@ -77,7 +78,7 @@ net_ifup() { |
296 | } |
297 | |
298 | net_ifdown() { |
299 | - check_program /sbin/ifdown |
300 | + check_program ifdown |
301 | |
302 | # systemd will automatically ifdown the interface on device |
303 | # removal by binding the instanced service to the network device |
304 | diff --git a/debian/ifupdown-rfkill b/debian/ifupdown-rfkill |
305 | new file mode 100755 |
306 | index 0000000..89c91c1 |
307 | --- /dev/null |
308 | +++ b/debian/ifupdown-rfkill |
309 | @@ -0,0 +1,23 @@ |
310 | +#!/bin/sh |
311 | +CHANGE=$3 |
312 | +SYSFS=$1 |
313 | +DEVICE=$SYSFS$2 |
314 | + |
315 | +PATH='/sbin:/bin:/usr/sbin:/usr/bin' |
316 | + |
317 | +if [ -e $DEVICE ] ; then |
318 | + while [ $DEVICE != $SYSFS ] ; do |
319 | + DEVICE=`dirname $DEVICE` |
320 | + |
321 | + if [ -d $DEVICE/net ] ; then |
322 | + for INTERFACE in $DEVICE/net/* ; do |
323 | + INTERFACE=`basename $INTERFACE` |
324 | + |
325 | + case $CHANGE in |
326 | + "1") ifup --allow=rfkill $INTERFACE ;; |
327 | + "0"|"2") ifdown --allow=rfkill $INTERFACE ;; |
328 | + esac |
329 | + done |
330 | + fi |
331 | + done |
332 | +fi |
333 | diff --git a/debian/ifupdown-rfkill.rules b/debian/ifupdown-rfkill.rules |
334 | new file mode 100644 |
335 | index 0000000..73c93d0 |
336 | --- /dev/null |
337 | +++ b/debian/ifupdown-rfkill.rules |
338 | @@ -0,0 +1,3 @@ |
339 | +# run ifupdown for each wlan rfkill change |
340 | +ACTION=="change", ENV{RFKILL_TYPE}=="wlan", SUBSYSTEM=="rfkill", \ |
341 | +RUN+="/usr/local/sbin/ifupdown-rfkill %S %p $env{RFKILL_STATE}" |
342 | diff --git a/debian/ifupdown.maintscript b/debian/ifupdown.maintscript |
343 | index 2203f84..4c2a73d 100644 |
344 | --- a/debian/ifupdown.maintscript |
345 | +++ b/debian/ifupdown.maintscript |
346 | @@ -1,9 +1,2 @@ |
347 | -rm_conffile /etc/default/ifupdown 0.7~+ ifupdown |
348 | -rm_conffile /etc/init.d/ifupdown 0.7~+ ifupdown |
349 | -rm_conffile /etc/init.d/ifupdown-clean 0.7~beta1 ifupdown |
350 | -rm_conffile /etc/init/networking.conf 0.8.25~ ifupdown |
351 | -rm_conffile /etc/init/network-interface-container.conf 0.8.25~ ifupdown |
352 | -rm_conffile /etc/init/network-interface-security.conf 0.8.25~ ifupdown |
353 | -rm_conffile /etc/init/network-interface.conf 0.8.25~ ifupdown |
354 | rm_conffile /etc/network/if-up.d/upstart 0.8.29~ ifupdown |
355 | rm_conffile /etc/network/if-down.d/upstart 0.8.29~ ifupdown |
356 | diff --git a/debian/networking.init b/debian/networking.init |
357 | index a4cc342..1a366ed 100644 |
358 | --- a/debian/networking.init |
359 | +++ b/debian/networking.init |
360 | @@ -9,13 +9,13 @@ |
361 | # Description: Prepare /run/network directory, ifstate file and raise network interfaces, or take them down. |
362 | ### END INIT INFO |
363 | |
364 | -PATH="/sbin:/bin" |
365 | +PATH="/sbin:/bin:/usr/sbin:/usr/bin" |
366 | RUN_DIR="/run/network" |
367 | IFSTATE="$RUN_DIR/ifstate" |
368 | STATEDIR="$RUN_DIR/state" |
369 | |
370 | -[ -x /sbin/ifup ] || exit 0 |
371 | -[ -x /sbin/ifdown ] || exit 0 |
372 | +[ -x "$(command -v ifup)" ] || exit 0 |
373 | +[ -x "$(command -v ifdown)" ] || exit 0 |
374 | |
375 | . /lib/lsb/init-functions |
376 | |
377 | @@ -130,9 +130,9 @@ start) |
378 | set -f |
379 | exclusions=$(process_exclusions) |
380 | log_action_begin_msg "Configuring network interfaces" |
381 | - if [ -x /bin/udevadm ]; then |
382 | + if [ -x "$(command -v udevadm)" ]; then |
383 | if [ -n "$(ifquery --list --exclude=lo)" ] || [ -n "$(ifquery --list --allow=hotplug)" ]; then |
384 | - /bin/udevadm settle || true |
385 | + udevadm settle || true |
386 | fi |
387 | fi |
388 | if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose |
389 | diff --git a/debian/networking.service b/debian/networking.service |
390 | index 593172b..cc403d8 100644 |
391 | --- a/debian/networking.service |
392 | +++ b/debian/networking.service |
393 | @@ -2,8 +2,7 @@ |
394 | Description=Raise network interfaces |
395 | Documentation=man:interfaces(5) |
396 | DefaultDependencies=no |
397 | -Requires=ifupdown-pre.service |
398 | -Wants=network.target |
399 | +Wants=network.target ifupdown-pre.service |
400 | After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service ifupdown-pre.service |
401 | Before=network.target shutdown.target network-online.target |
402 | Conflicts=shutdown.target |
403 | @@ -16,6 +15,8 @@ WantedBy=network-online.target |
404 | Type=oneshot |
405 | EnvironmentFile=-/etc/default/networking |
406 | ExecStart=/sbin/ifup -a --read-environment |
407 | +ExecStart=-/bin/sh -c 'if [ -f /run/network/restart-hotplug ]; then /sbin/ifup -a --read-environment --allow=hotplug; fi' |
408 | ExecStop=/sbin/ifdown -a --read-environment --exclude=lo |
409 | +ExecStopPost=/usr/bin/touch /run/network/restart-hotplug |
410 | RemainAfterExit=true |
411 | TimeoutStartSec=5min |
412 | diff --git a/debian/tests/control b/debian/tests/control |
413 | index 7b3f584..bfeeb75 100644 |
414 | --- a/debian/tests/control |
415 | +++ b/debian/tests/control |
416 | @@ -1,5 +1,5 @@ |
417 | Tests: hotplug |
418 | Depends: ifupdown |
419 | # requires udev, thus does not work in containers |
420 | -Restrictions: needs-root, isolation-machine |
421 | +Restrictions: needs-root, isolation-machine, needs-reboot |
422 | |
423 | diff --git a/debian/tests/hotplug b/debian/tests/hotplug |
424 | index 93993fb..469f0f0 100755 |
425 | --- a/debian/tests/hotplug |
426 | +++ b/debian/tests/hotplug |
427 | @@ -2,30 +2,46 @@ |
428 | # check behaviour of "allow-hotplug" interface |
429 | set -e |
430 | |
431 | +date -R |
432 | + |
433 | IFACE=sdtest42 |
434 | +IFACE_DUMMY=ethdummy0 |
435 | |
436 | -if [ -e /sys/class/net/$IFACE ]; then |
437 | - echo "SKIP: network interface $IFACE already exists" |
438 | - exit 0 |
439 | +if [ -z "$AUTOPKGTEST_REBOOT_MARK" ]; then |
440 | + if [ -e /sys/class/net/$IFACE ]; then |
441 | + echo "SKIP: network interface $IFACE already exists" |
442 | + exit 0 |
443 | + fi |
444 | fi |
445 | |
446 | # different kinds of installs/images have different conventions; e. g. |
447 | # cloud-init sources *.cfg, a Debian desktop sources only prefix-less files |
448 | if grep -q 'source-directory .*interfaces.d' /etc/network/interfaces; then |
449 | IFACE_CFG=/etc/network/interfaces.d/${IFACE} |
450 | + IFACE_DUMMY_CFG=/etc/network/interfaces.d/${IFACE_DUMMY} |
451 | elif grep -q 'source .*interfaces.d.*cfg' /etc/network/interfaces; then |
452 | IFACE_CFG=/etc/network/interfaces.d/${IFACE}.cfg |
453 | + IFACE_DUMMY_CFG=/etc/network/interfaces.d/${IFACE_DUMMY}.cfg |
454 | +elif grep -q 'source .*interfaces.d.*conf' /etc/network/interfaces; then |
455 | + IFACE_CFG=/etc/network/interfaces.d/${IFACE}.conf |
456 | + IFACE_DUMMY_CFG=/etc/network/interfaces.d/${IFACE_DUMMY}.conf |
457 | else |
458 | - echo "SKIP: /etc/network/interfaces does not include interfaces.d/" |
459 | - exit 0 |
460 | + echo "making /etc/network/interfaces source /e/n/interfaces.d/*.conf" |
461 | +cat <<EOF > /etc/network/interfaces |
462 | +source /etc/network/interfaces.d/*.conf |
463 | +EOF |
464 | + IFACE_CFG=/etc/network/interfaces.d/${IFACE}.conf |
465 | + IFACE_DUMMY_CFG=/etc/network/interfaces.d/${IFACE_DUMMY}.conf |
466 | fi |
467 | |
468 | +if [ -z "$AUTOPKGTEST_REBOOT_MARK" ]; then |
469 | cat <<EOF > $IFACE_CFG |
470 | allow-hotplug $IFACE |
471 | iface $IFACE inet static |
472 | address 192.168.234.129 |
473 | netmask 255.255.255.0 |
474 | EOF |
475 | +fi |
476 | |
477 | # these should trigger uevents and ifup@.service |
478 | ip link add name $IFACE type veth peer name v$IFACE |
479 | @@ -58,3 +74,42 @@ if echo "$OUT" | grep -q 'inet'; then |
480 | echo "$OUT" >&2 |
481 | exit 1 |
482 | fi |
483 | + |
484 | +echo "restarting network" |
485 | +systemctl restart networking |
486 | + |
487 | +sleep 3 |
488 | + |
489 | +echo "stop" |
490 | +systemctl stop networking |
491 | + |
492 | +if [ -z "$AUTOPKGTEST_REBOOT_MARK" ]; then |
493 | + echo "adding a dummy unplugged interface" |
494 | +cat <<EOF > $IFACE_DUMMY_CFG |
495 | +allow-hotplug $IFACE_DUMMY |
496 | +iface $IFACE_DUMMY inet dhcp |
497 | +EOF |
498 | +fi |
499 | + |
500 | +echo "start" |
501 | +systemctl start networking |
502 | + |
503 | +ip link show |
504 | + |
505 | +ip a |
506 | + |
507 | +echo "query" |
508 | +ifquery $IFACE_DUMMY |
509 | +echo "query state" |
510 | +! ifquery --state $IFACE_DUMMY |
511 | +if [ -d /run/systemd/system ]; then |
512 | + ! systemctl status -l ifup@${IFACE_DUMMY}.service |
513 | +fi |
514 | + |
515 | +date -R |
516 | + |
517 | +if [ -z "$AUTOPKGTEST_REBOOT_MARK" ]; then |
518 | + echo "preparing to reboot"; /tmp/autopkgtest-reboot mark1 |
519 | +fi |
520 | + |
521 | +echo "test end" |
522 | diff --git a/examples/ping-places.sh b/examples/ping-places.sh |
523 | index 6f6f2e1..aace711 100644 |
524 | --- a/examples/ping-places.sh |
525 | +++ b/examples/ping-places.sh |
526 | @@ -2,10 +2,10 @@ |
527 | |
528 | if [ `id -u` -ne 0 ] || [ "$1" = "" ]; then exit 1; fi |
529 | |
530 | -if [ -x /usr/bin/fping ]; then |
531 | - PING="/usr/bin/fping" |
532 | +if [ -x "$(command -v fping)" ]; then |
533 | + PING="fping" |
534 | else |
535 | - PING="/bin/ping -c 2" |
536 | + PING="ping -c 2" |
537 | fi |
538 | |
539 | iface="$1" |
540 | diff --git a/ifup.8 b/ifup.8 |
541 | index 728eab6..6ed49b6 100644 |
542 | --- a/ifup.8 |
543 | +++ b/ifup.8 |
544 | @@ -76,7 +76,7 @@ in |
545 | .I /etc/network/interfaces |
546 | will be brought down. |
547 | .TP |
548 | -.B \-\-force |
549 | +.BR \-f ", " \-\-force |
550 | Force configuration or deconfiguration of the interface. |
551 | .TP |
552 | .B \-\-ignore-errors |
553 | diff --git a/inet.defn b/inet.defn |
554 | index 6f70c49..bb78fa3 100644 |
555 | --- a/inet.defn |
556 | +++ b/inet.defn |
557 | @@ -78,16 +78,15 @@ method manual |
558 | method dhcp |
559 | description |
560 | This method may be used to obtain an address via DHCP with any of |
561 | - the tools: dhclient, pump, udhcpc, dhcpcd. |
562 | + the tools: dhclient, udhcpc, dhcpcd. |
563 | (They have been listed in their order of precedence.) |
564 | If you have a complicated DHCP setup you should |
565 | note that some of these clients use their own configuration files |
566 | and do not obtain their configuration information via *ifup*. |
567 | |
568 | options |
569 | - hostname hostname -- Hostname to be requested (pump, dhcpcd, udhcpc) |
570 | + hostname hostname -- Hostname to be requested (dhcpcd, udhcpc) |
571 | metric metric -- Metric for added routes (dhclient) |
572 | - leasehours leasehours -- Preferred lease time in hours (pump) |
573 | leasetime leasetime -- Preferred lease time in seconds (dhcpcd) |
574 | vendor vendor_id -- Vendor class identifier (dhcpcd) |
575 | client client_id -- Client identifier (dhcpcd), or "no" (dhclient) |
576 | @@ -98,28 +97,28 @@ method dhcp |
577 | |
578 | up |
579 | [[ip link set dev %iface% address %hwaddress%]] |
580 | +<<<<<<< inet.defn |
581 | CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
582 | +======= |
583 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
584 | +>>>>>>> inet.defn |
585 | [[-e IF_METRIC=%metric%]] \ |
586 | - if (execable("/sbin/dhclient")) |
587 | - /sbin/pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \ |
588 | - elsif (execable("/sbin/pump")) |
589 | - /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \ |
590 | - elsif (execable("/sbin/udhcpc")) |
591 | - /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
592 | + if (execable("dhclient")) |
593 | + udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \ |
594 | + elsif (execable("udhcpc")) |
595 | + dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
596 | [[-l %leasetime%]] [[-m %metric%]] %iface% \ |
597 | - elsif (execable("/sbin/dhcpcd")) |
598 | + elsif (execable("dhcpcd")) |
599 | echo 'No DHCP client software found!' >&2; false \ |
600 | elsif (1) |
601 | |
602 | down |
603 | - CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
604 | - if (execable("/sbin/dhclient")) |
605 | - /sbin/pump -i %iface% -r \ |
606 | - elsif (execable("/sbin/pump")) |
607 | - if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \ |
608 | - elsif (execable("/sbin/udhcpc")) |
609 | - /sbin/dhcpcd -k %iface% \ |
610 | - elsif (execable("/sbin/dhcpcd")) |
611 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
612 | + if (execable("dhclient")) |
613 | + if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \ |
614 | + elsif (execable("udhcpc")) |
615 | + dhcpcd -k %iface% \ |
616 | + elsif (execable("dhcpcd")) |
617 | echo 'No DHCP client software found!' >&2; false \ |
618 | elsif (1) |
619 | |
620 | @@ -138,7 +137,7 @@ method bootp |
621 | whatever it really is. |
622 | |
623 | up |
624 | - /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ |
625 | + bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ |
626 | [[--hwaddr %hwaddr%]] --returniffail --serverbcast |
627 | |
628 | down |
629 | @@ -179,9 +178,9 @@ method ppp |
630 | unit number -- Use /number/ as the ppp unit number. |
631 | options string -- Pass /string/ as additional options to pon. |
632 | up |
633 | - /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] |
634 | + pon [[%provider%]] [[unit %unit%]] [[%options%]] |
635 | down |
636 | - /usr/bin/poff [[%provider%]] |
637 | + poff [[%provider%]] |
638 | |
639 | method wvdial |
640 | description |
641 | @@ -190,10 +189,10 @@ method wvdial |
642 | options |
643 | provider name -- Use /name/ as the provider (from /etc/wvdial.conf). |
644 | up |
645 | - /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ |
646 | + start-stop-daemon --start -x /usr/bin/wvdial \ |
647 | -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]] |
648 | down |
649 | - /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ |
650 | + start-stop-daemon --stop -x /usr/bin/wvdial \ |
651 | -p /run/wvdial.%iface%.pid -s 2 |
652 | |
653 | |
654 | @@ -204,9 +203,9 @@ method ipv4ll |
655 | known as APIPA or IPAC, and often colloquially referred to |
656 | as "Zeroconf address". |
657 | up |
658 | - /usr/sbin/avahi-autoipd -D %iface% |
659 | + avahi-autoipd -D %iface% |
660 | down |
661 | - /usr/sbin/avahi-autoipd --kill %iface% |
662 | + avahi-autoipd --kill %iface% |
663 | |
664 | architecture kfreebsd |
665 | |
666 | @@ -215,11 +214,11 @@ method loopback |
667 | This method may be used to define the IPv4 loopback interface. |
668 | |
669 | up |
670 | - /sbin/ifconfig %iface% 127.0.0.1 up \ |
671 | + ifconfig %iface% 127.0.0.1 up \ |
672 | if (!iface_is_lo()) |
673 | |
674 | down |
675 | - /sbin/ifconfig %iface% down \ |
676 | + ifconfig %iface% down \ |
677 | if (!iface_is_lo()) |
678 | |
679 | method static |
680 | @@ -242,15 +241,15 @@ method static |
681 | hwaddress cleanup_hwaddress |
682 | |
683 | up |
684 | - [[ /sbin/ifconfig %iface% link %hwaddress%]] |
685 | - /sbin/ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \ |
686 | + [[ ifconfig %iface% link %hwaddress%]] |
687 | + ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \ |
688 | [[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \ |
689 | up |
690 | - [[ /sbin/route add default %gateway% ]] |
691 | + [[ route add default %gateway% ]] |
692 | |
693 | down |
694 | - [[ /sbin/route del default %gateway% 2>&1 1>/dev/null || true ]] |
695 | - /sbin/ifconfig %iface% down |
696 | + [[ route del default %gateway% 2>&1 1>/dev/null || true ]] |
697 | + ifconfig %iface% down |
698 | |
699 | method manual |
700 | description |
701 | @@ -283,30 +282,35 @@ method dhcp |
702 | hwaddress cleanup_hwaddress |
703 | |
704 | up |
705 | +<<<<<<< inet.defn |
706 | [[/sbin/ifconfig %iface% link %hwaddress%]] |
707 | CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
708 | +======= |
709 | + [[ifconfig %iface% link %hwaddress%]] |
710 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
711 | +>>>>>>> inet.defn |
712 | [[-e IF_METRIC=%metric%]] \ |
713 | - if (execable("/sbin/dhclient")) |
714 | - /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \ |
715 | + if (execable("dhclient")) |
716 | + udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \ |
717 | [[-c %client%]] \ |
718 | - elsif (execable("/sbin/udhcpc")) |
719 | - /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
720 | + elsif (execable("udhcpc")) |
721 | + dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
722 | [[-l %leasetime%]] %iface% \ |
723 | - elsif (execable("/sbin/dhcpcd")) |
724 | + elsif (execable("dhcpcd")) |
725 | echo 'No DHCP client software found!' >&2; false \ |
726 | elsif (1) |
727 | |
728 | down |
729 | - CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
730 | - if (execable("/sbin/dhclient")) |
731 | - if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \ |
732 | - elsif (execable("/sbin/udhcpc")) |
733 | - /sbin/dhcpcd -k %iface% \ |
734 | - elsif (execable("/sbin/dhcpcd")) |
735 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \ |
736 | + if (execable("dhclient")) |
737 | + if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \ |
738 | + elsif (execable("udhcpc")) |
739 | + dhcpcd -k %iface% \ |
740 | + elsif (execable("dhcpcd")) |
741 | echo 'No DHCP client software found!' >&2; false \ |
742 | elsif (1) |
743 | |
744 | - /sbin/ifconfig %iface% down |
745 | + ifconfig %iface% down |
746 | |
747 | method bootp |
748 | description |
749 | @@ -320,11 +324,11 @@ method bootp |
750 | whatever it really is. |
751 | |
752 | up |
753 | - /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ |
754 | + bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \ |
755 | [[--hwaddr %hwaddr%]] --returniffail --serverbcast |
756 | |
757 | down |
758 | - /sbin/ifconfig %iface% down |
759 | + ifconfig %iface% down |
760 | |
761 | method ppp |
762 | description |
763 | @@ -335,9 +339,9 @@ method ppp |
764 | unit number -- Use /number/ as the ppp unit number. |
765 | options string -- Pass /string/ as additional options to pon. |
766 | up |
767 | - /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] |
768 | + pon [[%provider%]] [[unit %unit%]] [[%options%]] |
769 | down |
770 | - /usr/bin/poff [[%provider%]] |
771 | + poff [[%provider%]] |
772 | |
773 | method wvdial |
774 | description |
775 | @@ -346,10 +350,10 @@ method wvdial |
776 | options |
777 | provider name -- Use /name/ as the provider (from /etc/wvdial.conf). |
778 | up |
779 | - /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ |
780 | + start-stop-daemon --start -x /usr/bin/wvdial \ |
781 | -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]] |
782 | down |
783 | - /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ |
784 | + start-stop-daemon --stop -x /usr/bin/wvdial \ |
785 | -p /run/wvdial.%iface%.pid -s 2 |
786 | |
787 | |
788 | @@ -360,9 +364,9 @@ method ipv4ll |
789 | known as APIPA or IPAC, and often colloquially referred to |
790 | as "Zeroconf address". |
791 | up |
792 | - /usr/sbin/avahi-autoipd -D %iface% |
793 | + avahi-autoipd -D %iface% |
794 | down |
795 | - /usr/sbin/avahi-autoipd --kill %iface% |
796 | + avahi-autoipd --kill %iface% |
797 | architecture hurd |
798 | |
799 | method loopback |
800 | @@ -436,24 +440,30 @@ method dhcp |
801 | |
802 | up |
803 | [[Warning: Option hwaddress: %hwaddress% not yet supported]] |
804 | +<<<<<<< inet.defn |
805 | CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ |
806 | if (execable("/sbin/dhclient")) |
807 | /sbin/udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \ |
808 | +======= |
809 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -1 -4 -v $CLIENT -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ |
810 | + if (execable("dhclient")) |
811 | + udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \ |
812 | +>>>>>>> inet.defn |
813 | [[-c %client%]] \ |
814 | - elsif (execable("/sbin/udhcpc")) |
815 | - /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
816 | + elsif (execable("udhcpc")) |
817 | + dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \ |
818 | [[-l %leasetime%]] %iface% \ |
819 | - elsif (execable("/sbin/dhcpcd")) |
820 | + elsif (execable("dhcpcd")) |
821 | echo 'No DHCP client software found!' >&2; false \ |
822 | elsif (1) |
823 | |
824 | down |
825 | - CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] /sbin/dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ |
826 | - if (execable("/sbin/dhclient")) |
827 | - if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface///.%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface///.%.pid); fi \ |
828 | - elsif (execable("/sbin/udhcpc")) |
829 | - /sbin/dhcpcd -k %iface% \ |
830 | - elsif (execable("/sbin/dhcpcd")) |
831 | + CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \ |
832 | + if (execable("dhclient")) |
833 | + if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(cat /run/udhcpc.%iface///.%.pid); kill -TERM $(cat /run/udhcpc.%iface///.%.pid); fi \ |
834 | + elsif (execable("udhcpc")) |
835 | + dhcpcd -k %iface% \ |
836 | + elsif (execable("dhcpcd")) |
837 | echo 'No DHCP client software found!' >&2; false \ |
838 | elsif (1) |
839 | |
840 | @@ -486,9 +496,9 @@ method ppp |
841 | unit number -- Use /number/ as the ppp unit number. |
842 | options string -- Pass /string/ as additional options to pon. |
843 | up |
844 | - /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]] |
845 | + pon [[%provider%]] [[unit %unit%]] [[%options%]] |
846 | down |
847 | - /usr/bin/poff [[%provider%]] |
848 | + poff [[%provider%]] |
849 | |
850 | method wvdial |
851 | description |
852 | @@ -497,10 +507,10 @@ method wvdial |
853 | options |
854 | provider name -- Use /name/ as the provider (from /etc/wvdial.conf). |
855 | up |
856 | - /sbin/start-stop-daemon --start -x /usr/bin/wvdial \ |
857 | + start-stop-daemon --start -x /usr/bin/wvdial \ |
858 | -p /run/wvdial.%iface///.%.pid -b -m -- [[ %provider% ]] |
859 | down |
860 | - /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \ |
861 | + start-stop-daemon --stop -x /usr/bin/wvdial \ |
862 | -p /run/wvdial.%iface///.%.pid -s 2 |
863 | |
864 | |
865 | @@ -511,6 +521,6 @@ method ipv4ll |
866 | known as APIPA or IPAC, and often colloquially referred to |
867 | as "Zeroconf address". |
868 | up |
869 | - /usr/sbin/avahi-autoipd -D %iface% |
870 | + avahi-autoipd -D %iface% |
871 | down |
872 | - /usr/sbin/avahi-autoipd --kill %iface% |
873 | + avahi-autoipd --kill %iface% |
874 | diff --git a/inet6.defn b/inet6.defn |
875 | index 4e5d26d..8fb6970 100644 |
876 | --- a/inet6.defn |
877 | +++ b/inet6.defn |
878 | @@ -21,22 +21,33 @@ method auto |
879 | ll-interval -- Link-local address polling interval in seconds [0.1] |
880 | |
881 | up |
882 | - /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
883 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]] |
884 | - -/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra% |
885 | - -/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=1 |
886 | + modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
887 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]] |
888 | + -sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra% |
889 | + -sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=1 |
890 | ip addr flush dev %iface% mngtmpaddr \ |
891 | if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd)) |
892 | ip link set dev %iface% up |
893 | /lib/ifupdown/wait-for-ll6.sh if (var_true("dhcp", ifd) && execable("/lib/ifupdown/wait-for-ll6.sh")) |
894 | +<<<<<<< inet6.defn |
895 | /sbin/dhclient -1 -6 -v -P -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
896 | if (var_true("dhcp", ifd) && execable("/sbin/dhclient") && var_true("request_prefix", ifd)) |
897 | /sbin/dhclient -1 -6 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
898 | elsif (var_true("dhcp", ifd) && execable("/sbin/dhclient")) |
899 | +======= |
900 | + dhclient -6 -1 -v -P -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
901 | + if (var_true("dhcp", ifd) && execable("dhclient") && var_true("request_prefix", ifd)) |
902 | + dhclient -6 -1 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
903 | + elsif (var_true("dhcp", ifd) && execable("dhclient")) |
904 | +>>>>>>> inet6.defn |
905 | echo 'No DHCPv6 client software found!' >&2; false \ |
906 | elsif (var_true("dhcp", ifd)) |
907 | |
908 | down |
909 | + dhclient -6 -v -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
910 | + if (var_true("dhcp", ifd) && execable("dhclient")) |
911 | + echo 'No DHCPv6 client software found!' >&2; false \ |
912 | + elsif (var_true("dhcp", ifd)) |
913 | ip -6 addr flush dev %iface% scope global |
914 | ip link set dev %iface% down \ |
915 | if (iface_is_link()) |
916 | @@ -82,11 +93,11 @@ method static |
917 | gateway (if_set 0) =accept_ra? |
918 | |
919 | up |
920 | - /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
921 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]] |
922 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]] |
923 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]] |
924 | - -[[if [ "$(/bin/cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then ip link set dev %iface% mtu %mtu%; else /sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]] |
925 | + modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
926 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]] |
927 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]] |
928 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]] |
929 | + -[[if [ "$(cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then ip link set dev %iface% mtu %mtu%; else sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]] |
930 | ip addr flush dev %iface% mngtmpaddr \ |
931 | if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd)) |
932 | ip link set dev %iface% [[address %hwaddress%]] up |
933 | @@ -119,7 +130,7 @@ method manual |
934 | hwaddress cleanup_hwaddress |
935 | |
936 | up |
937 | - -[[if [ "$(/bin/cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then ip link set dev %iface% mtu %mtu%; else /sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]] |
938 | + -[[if [ "$(cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then ip link set dev %iface% mtu %mtu%; else sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]] |
939 | [[ip link set dev %iface% address %hwaddress%]] |
940 | ip link set dev %iface% up 2>/dev/null || true |
941 | |
942 | @@ -147,29 +158,69 @@ method dhcp |
943 | hwaddress cleanup_hwaddress |
944 | |
945 | up |
946 | - /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
947 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]] |
948 | - -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]] |
949 | + modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
950 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]] |
951 | + -[[sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]] |
952 | ip addr flush dev %iface% mngtmpaddr \ |
953 | if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd)) |
954 | ip link set dev %iface% [[address %hwaddress%]] up |
955 | /lib/ifupdown/wait-for-ll6.sh if (execable("/lib/ifupdown/wait-for-ll6.sh")) |
956 | +<<<<<<< inet6.defn |
957 | /sbin/dhclient -1 -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -P -N -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
958 | if (execable("/sbin/dhclient") && var_true("request_prefix", ifd)) |
959 | /sbin/dhclient -1 -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
960 | elsif (execable("/sbin/dhclient")) |
961 | +======= |
962 | + dhclient -1 -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -P -N -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
963 | + if (execable("dhclient") && var_true("request_prefix", ifd)) |
964 | + dhclient -1 -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
965 | + elsif (execable("dhclient")) |
966 | +>>>>>>> inet6.defn |
967 | echo 'No DHCPv6 client software found!' >&2; false \ |
968 | elsif (1) |
969 | |
970 | down |
971 | - /sbin/dhclient -6 -v -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
972 | - if (execable("/sbin/dhclient")) |
973 | + dhclient -6 -v -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
974 | + if (execable("dhclient")) |
975 | echo 'No DHCPv6 client software found!' >&2; false \ |
976 | elsif (1) |
977 | |
978 | ip link set dev %iface% down \ |
979 | if (iface_is_link()) |
980 | |
981 | +method tunnel |
982 | + description |
983 | + This method is used to create IP6GRE, IP6IP6 or IPIP6 tunnels. You need to |
984 | + have the *ip* binary from the *iproute* package. For IP6GRE tunnels, you |
985 | + will need to load the ip6_gre module and the ip6_tunnel module for |
986 | + IP6IP6 or IPIP6 tunnels. |
987 | + options |
988 | + address address -- Local Address (colon delimited) |
989 | + netmask mask -- Netmask (number of bits, eg 64) |
990 | + mode type -- Tunnel type (either IP6GRE, IP6IP6 or IPIP6) *required* |
991 | + endpoint address -- Address of other tunnel endpoint (colon delimited) *required* |
992 | + dstaddr address -- Remote address (remote address inside tunnel) |
993 | + local address -- Address of the local endpoint (colon delimited) |
994 | + metric metric -- Routing metric for default gateway (integer) |
995 | + gateway address -- Default gateway (colon delimited) |
996 | + ttl time -- TTL setting |
997 | + mtu size -- MTU size |
998 | + encaplimit limit -- Encapsulation limit ("none" or integer) |
999 | + up |
1000 | + ip -6 tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \ |
1001 | + [[ttl %ttl%]] [[encaplimit %encaplimit%]] |
1002 | + ip link set %iface% up [[mtu %mtu%]] |
1003 | + [[ip -4 addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]] ]] \ |
1004 | + if (!var_strcasecmp("mode", "ipip6")) |
1005 | + [[ip -4 route add 0.0.0.0/0 via %gateway% [[metric %metric%]] dev %iface% onlink ]] \ |
1006 | + if (!var_strcasecmp("mode", "ipip6")) |
1007 | + [[ip -6 addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]] ]] \ |
1008 | + if (var_strcasecmp("mode", "ipip6")) |
1009 | + [[ip -6 route add ::/0 via %gateway% [[metric %metric%]] dev %iface% onlink ]] \ |
1010 | + if (var_strcasecmp("mode", "ipip6")) |
1011 | + down |
1012 | + ip -6 tunnel del %iface% |
1013 | + |
1014 | method v4tunnel |
1015 | description |
1016 | This method may be used to setup an IPv6-over-IPv4 tunnel. It requires |
1017 | @@ -192,7 +243,7 @@ method v4tunnel |
1018 | preferred-lifetime set_preferred_lft |
1019 | |
1020 | up |
1021 | - /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1022 | + modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1023 | ip tunnel add %iface% mode sit remote %endpoint% [[local %local%]] \ |
1024 | [[ttl %ttl%]] |
1025 | ip link set %iface% up [[mtu %mtu%]] |
1026 | @@ -221,7 +272,7 @@ method 6to4 |
1027 | preferred-lifetime set_preferred_lft |
1028 | |
1029 | up |
1030 | - /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1031 | + modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1032 | ip tunnel add %iface% mode sit remote any local %local% \ |
1033 | [[ttl %ttl%]] |
1034 | ip link set %iface% up [[mtu %mtu%]] |
1035 | @@ -240,10 +291,10 @@ method loopback |
1036 | description |
1037 | This method may be used to define the IPv6 loopback interface. |
1038 | up |
1039 | - /sbin/ifconfig %iface% inet6 ::1 \ |
1040 | + ifconfig %iface% inet6 ::1 \ |
1041 | if (!iface_is_lo()) |
1042 | down |
1043 | - /sbin/ifconfig %iface% down \ |
1044 | + ifconfig %iface% down \ |
1045 | if (!iface_is_lo()) |
1046 | |
1047 | method static |
1048 | @@ -263,14 +314,14 @@ method static |
1049 | hwaddress cleanup_hwaddress |
1050 | |
1051 | up |
1052 | - /sbin/ifconfig %iface% [[media %media%]] [[link %hwaddress%]] [[mtu %mtu%]] up |
1053 | - /sbin/ifconfig %iface% inet6 %address%[[/%netmask%]] alias |
1054 | - [[ /sbin/route add -inet6 ::/0 %gateway% ]] |
1055 | + ifconfig %iface% [[media %media%]] [[link %hwaddress%]] [[mtu %mtu%]] up |
1056 | + ifconfig %iface% inet6 %address%[[/%netmask%]] alias |
1057 | + [[ route add -inet6 ::/0 %gateway% ]] |
1058 | |
1059 | down |
1060 | - [[ /sbin/route -n del -inet6 ::/0 2>&1 1>/dev/null || true ]] |
1061 | - [[ /sbin/ifconfig %iface% inet6 %address% -alias ]] |
1062 | - /sbin/ifconfig %iface% down |
1063 | + [[ route -n del -inet6 ::/0 2>&1 1>/dev/null || true ]] |
1064 | + [[ ifconfig %iface% inet6 %address% -alias ]] |
1065 | + ifconfig %iface% down |
1066 | |
1067 | method manual |
1068 | description |
1069 | @@ -300,14 +351,20 @@ method auto |
1070 | hwaddress cleanup_hwaddress |
1071 | |
1072 | up |
1073 | +<<<<<<< inet6.defn |
1074 | /sbin/ifconfig %iface% inet6 accept_rtadv up |
1075 | /sbin/dhclient -1 -6 -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1076 | if (var_true("dhcp", ifd) && execable("/sbin/dhclient")) |
1077 | +======= |
1078 | + ifconfig %iface% inet6 accept_rtadv up |
1079 | + dhclient -1 -6 -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1080 | + if (var_true("dhcp", ifd) && execable("dhclient")) |
1081 | +>>>>>>> inet6.defn |
1082 | echo 'No DHCPv6 client software found!' >&2; false \ |
1083 | elsif (var_true("dhcp", ifd)) |
1084 | |
1085 | down |
1086 | - /sbin/ifconfig %iface% down |
1087 | + ifconfig %iface% down |
1088 | |
1089 | |
1090 | |
1091 | @@ -324,19 +381,25 @@ method dhcp |
1092 | hwaddress cleanup_hwaddress |
1093 | |
1094 | up |
1095 | +<<<<<<< inet6.defn |
1096 | /sbin/ifconfig %iface% [[link %hwaddress%]] up |
1097 | /sbin/dhclient -1 -6 -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1098 | if (execable("/sbin/dhclient")) |
1099 | +======= |
1100 | + ifconfig %iface% [[link %hwaddress%]] up |
1101 | + dhclient -1 -6 -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1102 | + if (execable("dhclient")) |
1103 | +>>>>>>> inet6.defn |
1104 | echo 'No DHCPv6 client software found!' >&2; false \ |
1105 | elsif (1) |
1106 | |
1107 | down |
1108 | - /sbin/dhclient -6 -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1109 | - if (execable("/sbin/dhclient")) |
1110 | + dhclient -6 -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \ |
1111 | + if (execable("dhclient")) |
1112 | echo 'No DHCPv6 client software found!' >&2; false \ |
1113 | elsif (1) |
1114 | |
1115 | - /sbin/ifconfig %iface% down |
1116 | + ifconfig %iface% down |
1117 | |
1118 | architecture hurd |
1119 | |
1120 | @@ -397,14 +460,19 @@ method dhcp |
1121 | up |
1122 | [[Warning: Option hwaddress: %hwaddress% not yet supported]] |
1123 | inetutils-ifconfig --interface %iface% --up |
1124 | +<<<<<<< inet6.defn |
1125 | /sbin/dhclient -1 -6 -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \ |
1126 | if (execable("/sbin/dhclient")) |
1127 | +======= |
1128 | + dhclient -1 -6 -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \ |
1129 | + if (execable("dhclient")) |
1130 | +>>>>>>> inet6.defn |
1131 | echo 'No DHCPv6 client software found!' >&2; false \ |
1132 | elsif (1) |
1133 | |
1134 | down |
1135 | - /sbin/dhclient -6 -r -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \ |
1136 | - if (execable("/sbin/dhclient")) |
1137 | + dhclient -6 -r -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \ |
1138 | + if (execable("dhclient")) |
1139 | echo 'No DHCPv6 client software found!' >&2; false \ |
1140 | elsif (1) |
1141 | |
1142 | diff --git a/interfaces.5.pre b/interfaces.5.pre |
1143 | index 1278fb1..7c3bdf4 100644 |
1144 | --- a/interfaces.5.pre |
1145 | +++ b/interfaces.5.pre |
1146 | @@ -346,9 +346,7 @@ prints an error message, |
1147 | and exits with status 0. |
1148 | This behavior may change in the future. |
1149 | .TP |
1150 | -.BI up " command" |
1151 | -.TP |
1152 | -.BI post\-up " command" |
1153 | +\fBup\fR \fIcommand\fR, \fBpost\-up\fR \fIcommand |
1154 | Run |
1155 | .I command |
1156 | after bringing the interface up. |
1157 | @@ -361,9 +359,7 @@ prints an error message, |
1158 | and exits with status 0. |
1159 | This behavior may change in the future. |
1160 | .TP |
1161 | -.BI down " command" |
1162 | -.TP |
1163 | -.BI pre\-down " command" |
1164 | +\fBdown\fR \fIcommand\fR, \fBpre\-down\fR \fIcommand\fR |
1165 | Run |
1166 | .I command |
1167 | before taking the interface down. |
1168 | diff --git a/link.defn b/link.defn |
1169 | index 8240e99..aa38634 100644 |
1170 | --- a/link.defn |
1171 | +++ b/link.defn |
1172 | @@ -27,8 +27,10 @@ method none |
1173 | if (iface_is_lo()) |
1174 | [[ip link set %iface0% alias "%description%"]] |
1175 | down |
1176 | - if test `cat /sys/class/net/%link%/type` -eq 32; then \ |
1177 | - echo 0x%vlan_id1% > /sys/class/net/%link%/delete_child; \ |
1178 | + if test -d /sys/class/net/%link%/device/infiniband; then \ |
1179 | + if test `cat /sys/class/net/%link%/type` -eq 32; then \ |
1180 | + echo 0x%vlan_id1% > /sys/class/net/%link%/delete_child; \ |
1181 | + fi \ |
1182 | else \ |
1183 | ip link del %iface%; \ |
1184 | fi if (iface_has(".") && !iface_has(":")) |
1185 | @@ -47,17 +49,17 @@ method none |
1186 | description description -- Link description [] |
1187 | |
1188 | up |
1189 | - -/sbin/ifconfig %iface% 127.0.0.1 up \ |
1190 | + -ifconfig %iface% 127.0.0.1 up \ |
1191 | if (iface_is_lo()) |
1192 | - -/sbin/ifconfig %iface% inet6 ::1 \ |
1193 | + -ifconfig %iface% inet6 ::1 \ |
1194 | if (iface_is_lo()) |
1195 | - [[-/sbin/ifconfig %iface% desc "%description%"]] |
1196 | + [[-ifconfig %iface% desc "%description%"]] |
1197 | down |
1198 | - -/sbin/ifconfig %iface% down \ |
1199 | + -ifconfig %iface% down \ |
1200 | if (iface_is_lo()) |
1201 | - [[-test -n "%description%" && /sbin/ifconfig %iface% -desc]] |
1202 | + [[-test -n "%description%" && ifconfig %iface% -desc]] |
1203 | rename |
1204 | - /sbin/ifconfig %iface% name %newname% |
1205 | + ifconfig %iface% name %newname% |
1206 | |
1207 | architecture hurd |
1208 | |
1209 | diff --git a/main.c b/main.c |
1210 | index fe69585..47747ed 100644 |
1211 | --- a/main.c |
1212 | +++ b/main.c |
1213 | @@ -94,7 +94,7 @@ static void help(int (*cmds) (interface_defn *)) { |
1214 | "\t--no-loopback don't act specially on the loopback device\n"); |
1215 | |
1216 | if (!(cmds == iface_list) && !(cmds == iface_query)) |
1217 | - printf( "\t--force force de/configuration\n" |
1218 | + printf( "\t-f, --force force de/configuration\n" |
1219 | "\t--ignore-errors ignore errors\n"); |
1220 | |
1221 | if ((cmds == iface_list) || (cmds == iface_query)) |
1222 | @@ -419,7 +419,7 @@ static void parse_environment_variables(void) { |
1223 | excludeint = realloc(excludeint, excludeints * sizeof *excludeint); |
1224 | if (excludeint == NULL) |
1225 | err(1, "realloc"); |
1226 | - excludeint[excludeints - 1] = tok; |
1227 | + excludeint[excludeints - 1] = strdup(tok); |
1228 | } |
1229 | free(excludes); |
1230 | } |
1231 | @@ -439,7 +439,7 @@ static void parse_options(int *argc, char **argv[]) { |
1232 | {"no-mappings", no_argument, NULL, 1}, |
1233 | {"no-scripts", no_argument, NULL, 4}, |
1234 | {"no-loopback", no_argument, NULL, 5}, |
1235 | - {"force", no_argument, NULL, 2}, |
1236 | + {"force", no_argument, NULL, 'f'}, |
1237 | {"ignore-errors", no_argument, NULL, 7}, |
1238 | {"option", required_argument, NULL, 'o'}, |
1239 | {"list", no_argument, NULL, 'l'}, |
1240 | @@ -450,7 +450,7 @@ static void parse_options(int *argc, char **argv[]) { |
1241 | }; |
1242 | |
1243 | for (;;) { |
1244 | - int c = getopt_long(*argc, *argv, "X:s:i:o:hVvnal", long_opts, NULL); |
1245 | + int c = getopt_long(*argc, *argv, "X:s:i:o:hVvnalf", long_opts, NULL); |
1246 | |
1247 | if (c == EOF) |
1248 | break; |
1249 | @@ -526,7 +526,7 @@ static void parse_options(int *argc, char **argv[]) { |
1250 | run_mappings = false; |
1251 | break; |
1252 | |
1253 | - case 2: /* --force */ |
1254 | + case 'f': /* --force */ |
1255 | if ((cmds == iface_list) || (cmds == iface_query)) |
1256 | usage(); |
1257 | force = true; |
1258 | diff --git a/tests/kfreebsd/down.1 b/tests/kfreebsd/down.1 |
1259 | index 7d112be..1eefc16 100644 |
1260 | --- a/tests/kfreebsd/down.1 |
1261 | +++ b/tests/kfreebsd/down.1 |
1262 | @@ -5,7 +5,7 @@ run-parts --verbose /etc/network/if-down.d |
1263 | ifdown: configuring interface eth0=eth0 (inet) |
1264 | run-parts --verbose /etc/network/if-down.d |
1265 | |
1266 | -/sbin/ifconfig eth0 down |
1267 | +ifconfig eth0 down |
1268 | run-parts --verbose /etc/network/if-post-down.d |
1269 | |
1270 | run-parts --verbose /etc/network/if-post-down.d |
1271 | diff --git a/tests/kfreebsd/down.2 b/tests/kfreebsd/down.2 |
1272 | index edfc43c..0601908 100644 |
1273 | --- a/tests/kfreebsd/down.2 |
1274 | +++ b/tests/kfreebsd/down.2 |
1275 | @@ -5,37 +5,37 @@ run-parts --verbose /etc/network/if-down.d |
1276 | ifdown: configuring interface eth5=eth5 (inet) |
1277 | run-parts --verbose /etc/network/if-down.d |
1278 | |
1279 | -/sbin/ifconfig eth5 down |
1280 | +ifconfig eth5 down |
1281 | run-parts --verbose /etc/network/if-post-down.d |
1282 | |
1283 | ifdown: configuring interface eth4=eth4 (inet) |
1284 | run-parts --verbose /etc/network/if-down.d |
1285 | |
1286 | -/sbin/ifconfig eth4 down |
1287 | +ifconfig eth4 down |
1288 | run-parts --verbose /etc/network/if-post-down.d |
1289 | |
1290 | ifdown: configuring interface eth3=eth3 (inet) |
1291 | run-parts --verbose /etc/network/if-down.d |
1292 | |
1293 | -/sbin/ifconfig eth3 down |
1294 | +ifconfig eth3 down |
1295 | run-parts --verbose /etc/network/if-post-down.d |
1296 | |
1297 | ifdown: configuring interface eth2=eth2 (inet) |
1298 | run-parts --verbose /etc/network/if-down.d |
1299 | |
1300 | -/sbin/ifconfig eth2 down |
1301 | +ifconfig eth2 down |
1302 | run-parts --verbose /etc/network/if-post-down.d |
1303 | |
1304 | ifdown: configuring interface eth1=eth1 (inet) |
1305 | run-parts --verbose /etc/network/if-down.d |
1306 | |
1307 | -/sbin/ifconfig eth1 down |
1308 | +ifconfig eth1 down |
1309 | run-parts --verbose /etc/network/if-post-down.d |
1310 | |
1311 | ifdown: configuring interface eth0=eth0 (inet) |
1312 | run-parts --verbose /etc/network/if-down.d |
1313 | |
1314 | -/sbin/ifconfig eth0 down |
1315 | +ifconfig eth0 down |
1316 | run-parts --verbose /etc/network/if-post-down.d |
1317 | |
1318 | run-parts --verbose /etc/network/if-post-down.d |
1319 | diff --git a/tests/kfreebsd/down.3 b/tests/kfreebsd/down.3 |
1320 | index 2061a6d..d5d32e8 100644 |
1321 | --- a/tests/kfreebsd/down.3 |
1322 | +++ b/tests/kfreebsd/down.3 |
1323 | @@ -5,13 +5,13 @@ run-parts --verbose /etc/network/if-down.d |
1324 | ifdown: configuring interface eth0=eth0 (inet) |
1325 | run-parts --verbose /etc/network/if-down.d |
1326 | |
1327 | -/sbin/ifconfig eth0 down |
1328 | +ifconfig eth0 down |
1329 | run-parts --verbose /etc/network/if-post-down.d |
1330 | ifdown: configuring interface eth0=eth0 (inet6) |
1331 | run-parts --verbose /etc/network/if-down.d |
1332 | - /sbin/route -n del -inet6 ::/0 2>&1 1>/dev/null || true |
1333 | - /sbin/ifconfig eth0 inet6 3ffe:ffff:100:f101::1 -alias |
1334 | -/sbin/ifconfig eth0 down |
1335 | + route -n del -inet6 ::/0 2>&1 1>/dev/null || true |
1336 | + ifconfig eth0 inet6 3ffe:ffff:100:f101::1 -alias |
1337 | +ifconfig eth0 down |
1338 | run-parts --verbose /etc/network/if-post-down.d |
1339 | |
1340 | run-parts --verbose /etc/network/if-post-down.d |
1341 | diff --git a/tests/kfreebsd/down.4 b/tests/kfreebsd/down.4 |
1342 | index 7405824..e7b538d 100644 |
1343 | --- a/tests/kfreebsd/down.4 |
1344 | +++ b/tests/kfreebsd/down.4 |
1345 | @@ -4,6 +4,6 @@ exit code: 0 |
1346 | ifdown: configuring interface eth0=work (inet) |
1347 | run-parts --verbose /etc/network/if-down.d |
1348 | |
1349 | -/sbin/ifconfig eth0 down |
1350 | +ifconfig eth0 down |
1351 | run-parts --verbose /etc/network/if-post-down.d |
1352 | |
1353 | diff --git a/tests/kfreebsd/down.5 b/tests/kfreebsd/down.5 |
1354 | index 7d112be..1eefc16 100644 |
1355 | --- a/tests/kfreebsd/down.5 |
1356 | +++ b/tests/kfreebsd/down.5 |
1357 | @@ -5,7 +5,7 @@ run-parts --verbose /etc/network/if-down.d |
1358 | ifdown: configuring interface eth0=eth0 (inet) |
1359 | run-parts --verbose /etc/network/if-down.d |
1360 | |
1361 | -/sbin/ifconfig eth0 down |
1362 | +ifconfig eth0 down |
1363 | run-parts --verbose /etc/network/if-post-down.d |
1364 | |
1365 | run-parts --verbose /etc/network/if-post-down.d |
1366 | diff --git a/tests/kfreebsd/down.6 b/tests/kfreebsd/down.6 |
1367 | index 7d112be..1eefc16 100644 |
1368 | --- a/tests/kfreebsd/down.6 |
1369 | +++ b/tests/kfreebsd/down.6 |
1370 | @@ -5,7 +5,7 @@ run-parts --verbose /etc/network/if-down.d |
1371 | ifdown: configuring interface eth0=eth0 (inet) |
1372 | run-parts --verbose /etc/network/if-down.d |
1373 | |
1374 | -/sbin/ifconfig eth0 down |
1375 | +ifconfig eth0 down |
1376 | run-parts --verbose /etc/network/if-post-down.d |
1377 | |
1378 | run-parts --verbose /etc/network/if-post-down.d |
1379 | diff --git a/tests/kfreebsd/up.1 b/tests/kfreebsd/up.1 |
1380 | index cfdf815..899584c 100644 |
1381 | --- a/tests/kfreebsd/up.1 |
1382 | +++ b/tests/kfreebsd/up.1 |
1383 | @@ -6,7 +6,7 @@ run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1384 | ifup: configuring interface eth0=eth0 (inet) |
1385 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1386 | |
1387 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1388 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1389 | |
1390 | echo hi |
1391 | echo hello |
1392 | diff --git a/tests/kfreebsd/up.2 b/tests/kfreebsd/up.2 |
1393 | index c513a45..8a4d2df 100644 |
1394 | --- a/tests/kfreebsd/up.2 |
1395 | +++ b/tests/kfreebsd/up.2 |
1396 | @@ -6,42 +6,42 @@ run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1397 | ifup: configuring interface eth0=eth0 (inet) |
1398 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1399 | |
1400 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1401 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1402 | |
1403 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1404 | |
1405 | ifup: configuring interface eth1=eth1 (inet) |
1406 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1407 | |
1408 | -/sbin/ifconfig eth1 1.3.4.5 netmask 255.255.255.0 up |
1409 | +ifconfig eth1 1.3.4.5 netmask 255.255.255.0 up |
1410 | |
1411 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1412 | |
1413 | ifup: configuring interface eth2=eth2 (inet) |
1414 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1415 | |
1416 | -/sbin/ifconfig eth2 1.4.5.6 netmask 255.255.255.0 up |
1417 | +ifconfig eth2 1.4.5.6 netmask 255.255.255.0 up |
1418 | |
1419 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1420 | |
1421 | ifup: configuring interface eth3=eth3 (inet) |
1422 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1423 | |
1424 | -/sbin/ifconfig eth3 1.5.6.7 netmask 255.255.255.0 up |
1425 | +ifconfig eth3 1.5.6.7 netmask 255.255.255.0 up |
1426 | |
1427 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1428 | |
1429 | ifup: configuring interface eth4=eth4 (inet) |
1430 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1431 | |
1432 | -/sbin/ifconfig eth4 1.7.8.9 netmask 255.255.255.0 up |
1433 | +ifconfig eth4 1.7.8.9 netmask 255.255.255.0 up |
1434 | |
1435 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1436 | |
1437 | ifup: configuring interface eth5=eth5 (inet) |
1438 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1439 | |
1440 | -/sbin/ifconfig eth5 1.8.9.10 netmask 255.255.255.0 up |
1441 | +ifconfig eth5 1.8.9.10 netmask 255.255.255.0 up |
1442 | |
1443 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1444 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1445 | diff --git a/tests/kfreebsd/up.3 b/tests/kfreebsd/up.3 |
1446 | index 87964f2..3e063d5 100644 |
1447 | --- a/tests/kfreebsd/up.3 |
1448 | +++ b/tests/kfreebsd/up.3 |
1449 | @@ -6,13 +6,13 @@ run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1450 | ifup: configuring interface eth0=eth0 (inet) |
1451 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1452 | |
1453 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1454 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1455 | |
1456 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1457 | ifup: configuring interface eth0=eth0 (inet6) |
1458 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1459 | -/sbin/ifconfig eth0 up |
1460 | -/sbin/ifconfig eth0 inet6 3ffe:ffff:100:f101::1/64 alias |
1461 | +ifconfig eth0 up |
1462 | +ifconfig eth0 inet6 3ffe:ffff:100:f101::1/64 alias |
1463 | |
1464 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1465 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1466 | diff --git a/tests/kfreebsd/up.4 b/tests/kfreebsd/up.4 |
1467 | index 177c87e..a9c6671 100644 |
1468 | --- a/tests/kfreebsd/up.4 |
1469 | +++ b/tests/kfreebsd/up.4 |
1470 | @@ -5,7 +5,7 @@ exit code: 0 |
1471 | ifup: configuring interface eth0=work (inet) |
1472 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1473 | |
1474 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1475 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1476 | |
1477 | echo hi |
1478 | echo hello |
1479 | diff --git a/tests/kfreebsd/up.5 b/tests/kfreebsd/up.5 |
1480 | index d1a02ef..801e95e 100644 |
1481 | --- a/tests/kfreebsd/up.5 |
1482 | +++ b/tests/kfreebsd/up.5 |
1483 | @@ -5,8 +5,8 @@ run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1484 | |
1485 | ifup: configuring interface eth0=eth0 (inet) |
1486 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1487 | - /sbin/ifconfig eth0 link 00:DE:AD:00:BE:AF |
1488 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1489 | + ifconfig eth0 link 00:DE:AD:00:BE:AF |
1490 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1491 | |
1492 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1493 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1494 | diff --git a/tests/kfreebsd/up.6 b/tests/kfreebsd/up.6 |
1495 | index d1a02ef..801e95e 100644 |
1496 | --- a/tests/kfreebsd/up.6 |
1497 | +++ b/tests/kfreebsd/up.6 |
1498 | @@ -5,8 +5,8 @@ run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1499 | |
1500 | ifup: configuring interface eth0=eth0 (inet) |
1501 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1502 | - /sbin/ifconfig eth0 link 00:DE:AD:00:BE:AF |
1503 | -/sbin/ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1504 | + ifconfig eth0 link 00:DE:AD:00:BE:AF |
1505 | +ifconfig eth0 1.2.3.4 netmask 255.255.255.0 up |
1506 | |
1507 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1508 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1509 | diff --git a/tests/linux/down.19 b/tests/linux/down.19 |
1510 | new file mode 100644 |
1511 | index 0000000..344adea |
1512 | --- /dev/null |
1513 | +++ b/tests/linux/down.19 |
1514 | @@ -0,0 +1,28 @@ |
1515 | +exit code: 0 |
1516 | +====stdout==== |
1517 | +====stderr==== |
1518 | +ifdown: configuring interface tunnel1=tunnel1 (inet6) |
1519 | +run-parts --verbose /etc/network/if-down.d |
1520 | +ip -6 tunnel del tunnel1 |
1521 | +run-parts --verbose /etc/network/if-post-down.d |
1522 | + |
1523 | +ifdown: configuring interface tunnel2=tunnel2 (inet6) |
1524 | +run-parts --verbose /etc/network/if-down.d |
1525 | +ip -6 tunnel del tunnel2 |
1526 | +run-parts --verbose /etc/network/if-post-down.d |
1527 | + |
1528 | +ifdown: configuring interface tunnel3=tunnel3 (inet6) |
1529 | +run-parts --verbose /etc/network/if-down.d |
1530 | +ip -6 tunnel del tunnel3 |
1531 | +run-parts --verbose /etc/network/if-post-down.d |
1532 | + |
1533 | +ifdown: configuring interface tunnel4=tunnel4 (inet6) |
1534 | +run-parts --verbose /etc/network/if-down.d |
1535 | +ip -6 tunnel del tunnel4 |
1536 | +run-parts --verbose /etc/network/if-post-down.d |
1537 | + |
1538 | +ifdown: configuring interface tunnel5=tunnel5 (inet6) |
1539 | +run-parts --verbose /etc/network/if-down.d |
1540 | +ip -6 tunnel del tunnel5 |
1541 | +run-parts --verbose /etc/network/if-post-down.d |
1542 | + |
1543 | diff --git a/tests/linux/down.7 b/tests/linux/down.7 |
1544 | index 5adbcaa..6a6ff67 100644 |
1545 | --- a/tests/linux/down.7 |
1546 | +++ b/tests/linux/down.7 |
1547 | @@ -12,40 +12,40 @@ run-parts --verbose /etc/network/if-post-down.d |
1548 | ifdown: configuring interface br0.0202=br0.0202 (inet) |
1549 | run-parts --verbose /etc/network/if-down.d |
1550 | run-parts --verbose /etc/network/if-post-down.d |
1551 | -if test `cat /sys/class/net/br0/type` -eq 32; then echo 0x0202 > /sys/class/net/br0/delete_child; else ip link del br0.0202; fi |
1552 | +if test -d /sys/class/net/br0/device/infiniband; then if test `cat /sys/class/net/br0/type` -eq 32; then echo 0x0202 > /sys/class/net/br0/delete_child; fi else ip link del br0.0202; fi |
1553 | |
1554 | ifdown: configuring interface br0.0201=br0.0201 (inet) |
1555 | run-parts --verbose /etc/network/if-down.d |
1556 | run-parts --verbose /etc/network/if-post-down.d |
1557 | -if test `cat /sys/class/net/br0/type` -eq 32; then echo 0x0201 > /sys/class/net/br0/delete_child; else ip link del br0.0201; fi |
1558 | +if test -d /sys/class/net/br0/device/infiniband; then if test `cat /sys/class/net/br0/type` -eq 32; then echo 0x0201 > /sys/class/net/br0/delete_child; fi else ip link del br0.0201; fi |
1559 | |
1560 | ifdown: configuring interface eth0.0201=eth0.0201 (inet) |
1561 | run-parts --verbose /etc/network/if-down.d |
1562 | |
1563 | ip addr del 192.168.0.1/255.255.255.128 broadcast 192.168.0.127 dev eth0.0201 label eth0.0201 |
1564 | run-parts --verbose /etc/network/if-post-down.d |
1565 | -if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x0201 > /sys/class/net/eth0/delete_child; else ip link del eth0.0201; fi |
1566 | +if test -d /sys/class/net/eth0/device/infiniband; then if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x0201 > /sys/class/net/eth0/delete_child; fi else ip link del eth0.0201; fi |
1567 | |
1568 | ifdown: configuring interface eth0.1=eth0.1 (inet6) |
1569 | run-parts --verbose /etc/network/if-down.d |
1570 | |
1571 | ip -6 addr del 3ffe:ffff:120:f101::1/64 dev eth0.1 |
1572 | run-parts --verbose /etc/network/if-post-down.d |
1573 | -if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x1 > /sys/class/net/eth0/delete_child; else ip link del eth0.1; fi |
1574 | +if test -d /sys/class/net/eth0/device/infiniband; then if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x1 > /sys/class/net/eth0/delete_child; fi else ip link del eth0.1; fi |
1575 | |
1576 | ifdown: configuring interface eth0.1=eth0.1 (inet6) |
1577 | run-parts --verbose /etc/network/if-down.d |
1578 | |
1579 | ip -6 addr del 3ffe:ffff:120:f101::1/64 dev eth0.1 |
1580 | run-parts --verbose /etc/network/if-post-down.d |
1581 | -if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x1 > /sys/class/net/eth0/delete_child; else ip link del eth0.1; fi |
1582 | +if test -d /sys/class/net/eth0/device/infiniband; then if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x1 > /sys/class/net/eth0/delete_child; fi else ip link del eth0.1; fi |
1583 | |
1584 | ifdown: configuring interface eth0.0201=eth0.0201 (inet) |
1585 | run-parts --verbose /etc/network/if-down.d |
1586 | |
1587 | ip addr del 192.168.0.1/255.255.255.128 broadcast 192.168.0.127 dev eth0.0201 label eth0.0201 |
1588 | run-parts --verbose /etc/network/if-post-down.d |
1589 | -if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x0201 > /sys/class/net/eth0/delete_child; else ip link del eth0.0201; fi |
1590 | +if test -d /sys/class/net/eth0/device/infiniband; then if test `cat /sys/class/net/eth0/type` -eq 32; then echo 0x0201 > /sys/class/net/eth0/delete_child; fi else ip link del eth0.0201; fi |
1591 | |
1592 | ifdown: configuring interface eth0=eth0 (inet) |
1593 | run-parts --verbose /etc/network/if-down.d |
1594 | diff --git a/tests/linux/down.8 b/tests/linux/down.8 |
1595 | index ff48663..370fd69 100644 |
1596 | --- a/tests/linux/down.8 |
1597 | +++ b/tests/linux/down.8 |
1598 | @@ -13,7 +13,7 @@ run-parts --verbose /etc/network/if-down.d |
1599 | |
1600 | ip addr del 2.3.4.5/255.255.255.0 broadcast 2.3.4.255 dev eth2.2 label eth2.2 |
1601 | run-parts --verbose /etc/network/if-post-down.d |
1602 | -if test `cat /sys/class/net/eth2/type` -eq 32; then echo 0x2 > /sys/class/net/eth2/delete_child; else ip link del eth2.2; fi |
1603 | +if test -d /sys/class/net/eth2/device/infiniband; then if test `cat /sys/class/net/eth2/type` -eq 32; then echo 0x2 > /sys/class/net/eth2/delete_child; fi else ip link del eth2.2; fi |
1604 | |
1605 | ifdown: configuring interface eth1:1=eth1:1 (inet) |
1606 | run-parts --verbose /etc/network/if-down.d |
1607 | diff --git a/tests/linux/testcase.19 b/tests/linux/testcase.19 |
1608 | new file mode 100644 |
1609 | index 0000000..9edbe23 |
1610 | --- /dev/null |
1611 | +++ b/tests/linux/testcase.19 |
1612 | @@ -0,0 +1,43 @@ |
1613 | +# RUN: --no-loopback tunnel1 |
1614 | +iface tunnel1 inet6 tunnel |
1615 | + address fd00::1 |
1616 | + netmask 48 |
1617 | + mode ip6ip6 |
1618 | + endpoint 2001:db8::2 |
1619 | + local 2001:db8::1 |
1620 | + encaplimit none |
1621 | + |
1622 | +# RUN: --no-loopback tunnel2 |
1623 | +iface tunnel2 inet6 tunnel |
1624 | + address fd00::1 |
1625 | + netmask 48 |
1626 | + mode ip6ip6 |
1627 | + endpoint 2001:db8::2 |
1628 | + local 2001:db8::1 |
1629 | + encaplimit none |
1630 | + gateway fd00::2 |
1631 | + |
1632 | +# RUN: --no-loopback tunnel3 |
1633 | +iface tunnel3 inet6 tunnel |
1634 | + address 192.0.2.1 |
1635 | + netmask 24 |
1636 | + mode ipip6 |
1637 | + endpoint 2001:db8::2 |
1638 | + local 2001:db8::1 |
1639 | + |
1640 | +# RUN: --no-loopback tunnel4 |
1641 | +iface tunnel4 inet6 tunnel |
1642 | + address 192.0.2.1 |
1643 | + netmask 24 |
1644 | + mode ipip6 |
1645 | + endpoint 2001:db8::2 |
1646 | + local 2001:db8::1 |
1647 | + gateway 192.0.2.2 |
1648 | + |
1649 | +# RUN: --no-loopback tunnel5 |
1650 | +iface tunnel5 inet6 tunnel |
1651 | + address fd00::1 |
1652 | + netmask 48 |
1653 | + mode ip6gre |
1654 | + endpoint 2001:db8::2 |
1655 | + local 2001:db8::1 |
1656 | diff --git a/tests/linux/up.16 b/tests/linux/up.16 |
1657 | index 8c07dab..5b76a9b 100644 |
1658 | --- a/tests/linux/up.16 |
1659 | +++ b/tests/linux/up.16 |
1660 | @@ -23,11 +23,11 @@ ip link set dev eth1 mtu 1500 address 12:34:56:89:0a:bc up |
1661 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1662 | ifup: configuring interface eth1=eth1 (inet6) |
1663 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1664 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1665 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1666 | |
1667 | |
1668 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1669 | -if [ "$(/bin/cat /sys/class/net/eth1/mtu)" -lt 1492 ]; then ip link set dev eth1 mtu 1492; else /sbin/sysctl -q -e -w net.ipv6.conf.eth1.mtu=1492; fi |
1670 | +sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1671 | +if [ "$(cat /sys/class/net/eth1/mtu)" -lt 1492 ]; then ip link set dev eth1 mtu 1492; else sysctl -q -e -w net.ipv6.conf.eth1.mtu=1492; fi |
1672 | ip link set dev eth1 address 12:34:ff:fe:0a:bc up |
1673 | ip -6 addr add 3ffe:ffff:120::fffe:1/64 dev eth1 |
1674 | |
1675 | @@ -41,11 +41,11 @@ ip link set dev eth2 mtu 1500 address 12:34:56:89:0a:bc up |
1676 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1677 | ifup: configuring interface eth2=eth2 (inet6) |
1678 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1679 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1680 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1681 | |
1682 | |
1683 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth2.autoconf=0 |
1684 | -if [ "$(/bin/cat /sys/class/net/eth2/mtu)" -lt 1492 ]; then ip link set dev eth2 mtu 1492; else /sbin/sysctl -q -e -w net.ipv6.conf.eth2.mtu=1492; fi |
1685 | +sysctl -q -e -w net.ipv6.conf.eth2.autoconf=0 |
1686 | +if [ "$(cat /sys/class/net/eth2/mtu)" -lt 1492 ]; then ip link set dev eth2 mtu 1492; else sysctl -q -e -w net.ipv6.conf.eth2.mtu=1492; fi |
1687 | ip link set dev eth2 address 12:34:ff:fe:0a:bc up |
1688 | ip -6 addr add 3ffe:ffff:120::fffe:1/64 dev eth2 |
1689 | |
1690 | diff --git a/tests/linux/up.19 b/tests/linux/up.19 |
1691 | new file mode 100644 |
1692 | index 0000000..e9c963f |
1693 | --- /dev/null |
1694 | +++ b/tests/linux/up.19 |
1695 | @@ -0,0 +1,43 @@ |
1696 | +exit code: 0 |
1697 | +====stdout==== |
1698 | +====stderr==== |
1699 | + |
1700 | +ifup: configuring interface tunnel1=tunnel1 (inet6) |
1701 | +run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1702 | +ip -6 tunnel add tunnel1 mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none |
1703 | +ip link set tunnel1 up |
1704 | +ip -6 addr add fd00::1/48 dev tunnel1 |
1705 | + |
1706 | +run-parts --exit-on-error --verbose /etc/network/if-up.d |
1707 | + |
1708 | +ifup: configuring interface tunnel2=tunnel2 (inet6) |
1709 | +run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1710 | +ip -6 tunnel add tunnel2 mode ip6ip6 remote 2001:db8::2 local 2001:db8::1 encaplimit none |
1711 | +ip link set tunnel2 up |
1712 | +ip -6 addr add fd00::1/48 dev tunnel2 |
1713 | +ip -6 route add ::/0 via fd00::2 dev tunnel2 onlink |
1714 | +run-parts --exit-on-error --verbose /etc/network/if-up.d |
1715 | + |
1716 | +ifup: configuring interface tunnel3=tunnel3 (inet6) |
1717 | +run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1718 | +ip -6 tunnel add tunnel3 mode ipip6 remote 2001:db8::2 local 2001:db8::1 |
1719 | +ip link set tunnel3 up |
1720 | +ip -4 addr add 192.0.2.1/24 dev tunnel3 |
1721 | + |
1722 | +run-parts --exit-on-error --verbose /etc/network/if-up.d |
1723 | + |
1724 | +ifup: configuring interface tunnel4=tunnel4 (inet6) |
1725 | +run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1726 | +ip -6 tunnel add tunnel4 mode ipip6 remote 2001:db8::2 local 2001:db8::1 |
1727 | +ip link set tunnel4 up |
1728 | +ip -4 addr add 192.0.2.1/24 dev tunnel4 |
1729 | +ip -4 route add 0.0.0.0/0 via 192.0.2.2 dev tunnel4 onlink |
1730 | +run-parts --exit-on-error --verbose /etc/network/if-up.d |
1731 | + |
1732 | +ifup: configuring interface tunnel5=tunnel5 (inet6) |
1733 | +run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1734 | +ip -6 tunnel add tunnel5 mode ip6gre remote 2001:db8::2 local 2001:db8::1 |
1735 | +ip link set tunnel5 up |
1736 | +ip -6 addr add fd00::1/48 dev tunnel5 |
1737 | + |
1738 | +run-parts --exit-on-error --verbose /etc/network/if-up.d |
1739 | diff --git a/tests/linux/up.3 b/tests/linux/up.3 |
1740 | index 41471f8..7dca6a1 100644 |
1741 | --- a/tests/linux/up.3 |
1742 | +++ b/tests/linux/up.3 |
1743 | @@ -11,10 +11,10 @@ ip link set dev eth0 up |
1744 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1745 | ifup: configuring interface eth0=eth0 (inet6) |
1746 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1747 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1748 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1749 | |
1750 | |
1751 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1752 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1753 | |
1754 | ip link set dev eth0 up |
1755 | ip -6 addr add 3ffe:ffff:100:f101::1/64 dev eth0 nodad |
1756 | @@ -22,10 +22,10 @@ ip -6 addr add 3ffe:ffff:100:f101::1/64 dev eth0 nodad |
1757 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1758 | ifup: configuring interface eth0=eth0 (inet6) |
1759 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1760 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1761 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1762 | |
1763 | |
1764 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1765 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1766 | |
1767 | ip link set dev eth0 up |
1768 | ip -6 addr add 3ffe:ffff:100:f101::2/64 dev eth0 nodad |
1769 | @@ -33,10 +33,10 @@ ip -6 addr add 3ffe:ffff:100:f101::2/64 dev eth0 nodad |
1770 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1771 | ifup: configuring interface eth0=eth0 (inet6) |
1772 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1773 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1774 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1775 | |
1776 | |
1777 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1778 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1779 | |
1780 | ip link set dev eth0 up |
1781 | ip -6 addr add 3ffe:ffff:100:f101::3/64 dev eth0 nodad |
1782 | @@ -44,10 +44,10 @@ ip -6 addr add 3ffe:ffff:100:f101::3/64 dev eth0 nodad |
1783 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1784 | ifup: configuring interface eth0=eth0 (inet6) |
1785 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1786 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1787 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1788 | |
1789 | |
1790 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1791 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1792 | |
1793 | ip link set dev eth0 up |
1794 | ip -6 addr add 3ffe:ffff:100:f101::4 dev eth0 nodad |
1795 | @@ -55,10 +55,10 @@ ip -6 addr add 3ffe:ffff:100:f101::4 dev eth0 nodad |
1796 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1797 | ifup: configuring interface eth0=eth0 (inet6) |
1798 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1799 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1800 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1801 | |
1802 | |
1803 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1804 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1805 | |
1806 | ip link set dev eth0 up |
1807 | ip -6 addr add 3ffe:ffff:100:f101::5/128 dev eth0 nodad |
1808 | @@ -66,10 +66,10 @@ ip -6 addr add 3ffe:ffff:100:f101::5/128 dev eth0 nodad |
1809 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1810 | ifup: configuring interface eth0=eth0 (inet6) |
1811 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1812 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1813 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1814 | |
1815 | |
1816 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1817 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1818 | |
1819 | ip link set dev eth0 up |
1820 | ip -6 addr add 64 dev eth0 nodad |
1821 | @@ -82,10 +82,10 @@ ifup: failed to bring up eth0 |
1822 | |
1823 | ifup: configuring interface eth1=eth1 (inet6) |
1824 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1825 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1826 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1827 | |
1828 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth1.accept_ra=0 |
1829 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1830 | +sysctl -q -e -w net.ipv6.conf.eth1.accept_ra=0 |
1831 | +sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1832 | |
1833 | ip addr flush dev eth1 mngtmpaddr |
1834 | ip link set dev eth1 up |
1835 | @@ -94,10 +94,10 @@ ip -6 addr add 3ffe:ffff:100:f102::1/64 dev eth1 nodad |
1836 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1837 | ifup: configuring interface eth1=eth1 (inet6) |
1838 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1839 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1840 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1841 | |
1842 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth1.accept_ra=1 |
1843 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1844 | +sysctl -q -e -w net.ipv6.conf.eth1.accept_ra=1 |
1845 | +sysctl -q -e -w net.ipv6.conf.eth1.autoconf=0 |
1846 | |
1847 | ip link set dev eth1 up |
1848 | ip -6 addr add 3ffe:ffff:100:f102::6/64 dev eth1 nodad |
1849 | diff --git a/tests/linux/up.7 b/tests/linux/up.7 |
1850 | index 6b636b2..0075498 100644 |
1851 | --- a/tests/linux/up.7 |
1852 | +++ b/tests/linux/up.7 |
1853 | @@ -11,10 +11,10 @@ ip link set dev eth0 up |
1854 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1855 | ifup: configuring interface eth0=eth0 (inet6) |
1856 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1857 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1858 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1859 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1860 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1861 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1862 | +sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1863 | +sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1864 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1865 | |
1866 | ip addr flush dev eth0 mngtmpaddr |
1867 | ip link set dev eth0 up |
1868 | @@ -30,10 +30,10 @@ ip link set dev eth0 up |
1869 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1870 | ifup: configuring interface eth0=eth0 (inet6) |
1871 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1872 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1873 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1874 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1875 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1876 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1877 | +sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1878 | +sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1879 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1880 | |
1881 | ip addr flush dev eth0 mngtmpaddr |
1882 | ip link set dev eth0 up |
1883 | @@ -44,10 +44,10 @@ if test -d /sys/class/net/eth0 && ! ip link show eth0.1 >/dev/null 2>&1; |
1884 | |
1885 | ifup: configuring interface eth0.1=eth0.1 (inet6) |
1886 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1887 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1888 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1889 | |
1890 | |
1891 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0/1.autoconf=0 |
1892 | +sysctl -q -e -w net.ipv6.conf.eth0/1.autoconf=0 |
1893 | |
1894 | ip link set dev eth0.1 up |
1895 | ip -6 addr add 3ffe:ffff:120:f101::1/64 dev eth0.1 nodad |
1896 | @@ -62,10 +62,10 @@ ip link set dev eth0 up |
1897 | run-parts --exit-on-error --verbose /etc/network/if-up.d |
1898 | ifup: configuring interface eth0=eth0 (inet6) |
1899 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1900 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1901 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1902 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1903 | -/sbin/sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1904 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1905 | +sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2 |
1906 | +sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=0 |
1907 | +sysctl -q -e -w net.ipv6.conf.eth0.autoconf=0 |
1908 | |
1909 | ip addr flush dev eth0 mngtmpaddr |
1910 | ip link set dev eth0 up |
1911 | @@ -99,7 +99,7 @@ run-parts --exit-on-error --verbose /etc/network/if-up.d |
1912 | |
1913 | ifup: configuring interface tunnel=tunnel (inet6) |
1914 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1915 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1916 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1917 | ip tunnel add tunnel mode sit remote any local 1.2.3.4 |
1918 | ip link set tunnel up |
1919 | ip addr add 2002:0102:0304::1/16 dev tunnel |
1920 | diff --git a/tests/linux/up.9 b/tests/linux/up.9 |
1921 | index 608c2e3..e0123ec 100644 |
1922 | --- a/tests/linux/up.9 |
1923 | +++ b/tests/linux/up.9 |
1924 | @@ -4,7 +4,7 @@ exit code: 0 |
1925 | |
1926 | ifup: configuring interface tunnel=tunnel (inet6) |
1927 | run-parts --exit-on-error --verbose /etc/network/if-pre-up.d |
1928 | -/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1929 | +modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure. |
1930 | ip tunnel add tunnel mode sit remote any local 2.3.4.5 |
1931 | ip link set tunnel up |
1932 | ip addr add 2002:0203:0405::1/16 dev tunnel |
1933 | diff --git a/tests/testbuild-linux b/tests/testbuild-linux |
1934 | index 1181ea0..2fa1b8b 100755 |
1935 | --- a/tests/testbuild-linux |
1936 | +++ b/tests/testbuild-linux |
1937 | @@ -3,7 +3,7 @@ |
1938 | dir=tests/linux |
1939 | |
1940 | result=true |
1941 | -for test in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18; do |
1942 | +for test in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do |
1943 | if [ -e $dir/testcase.$test ]; then |
1944 | args="$(cat $dir/testcase.$test | sed -n 's/^# RUN: //p')" |
1945 | else |
1946 | diff --git a/wait-online.sh b/wait-online.sh |
1947 | index dbcdaeb..c4963f7 100755 |
1948 | --- a/wait-online.sh |
1949 | +++ b/wait-online.sh |
1950 | @@ -11,7 +11,7 @@ WAIT_ONLINE_TIMEOUT=300 |
1951 | case "$WAIT_ONLINE_METHOD" in |
1952 | route) |
1953 | [ -n "$WAIT_ONLINE_ADDRESS" ] || WAIT_ONLINE_ADDRESS=default |
1954 | - (/usr/bin/timeout "$WAIT_ONLINE_TIMEOUT" ip mon r & ip -4 r s; ip -6 r s) | /bin/grep -q "^$WAIT_ONLINE_ADDRESS\>" |
1955 | + (timeout "$WAIT_ONLINE_TIMEOUT" ip mon r & ip -4 r s; ip -6 r s) | grep -q "^$WAIT_ONLINE_ADDRESS\>" |
1956 | ;; |
1957 | |
1958 | ping) |
1959 | @@ -19,7 +19,7 @@ ping) |
1960 | echo "No WAIT_ONLINE_ADDRESS specified" >&2 |
1961 | exit 1 |
1962 | fi |
1963 | - /usr/bin/timeout "$WAIT_ONLINE_TIMEOUT" /bin/sh -c 'while ! /bin/ping -q -c 1 -W 1 "'$WAIT_ONLINE_ADDRESS'" >/dev/null; do sleep 1; done' |
1964 | + timeout "$WAIT_ONLINE_TIMEOUT" sh -c 'while ! ping -q -c 1 -W 1 "'$WAIT_ONLINE_ADDRESS'" >/dev/null; do sleep 1; done' |
1965 | ;; |
1966 | |
1967 | ping6) |
1968 | @@ -27,19 +27,19 @@ ping6) |
1969 | echo "No WAIT_ONLINE_ADDRESS specified" >&2 |
1970 | exit 1 |
1971 | fi |
1972 | - /usr/bin/timeout "$WAIT_ONLINE_TIMEOUT" /bin/sh -c 'while ! /bin/ping6 -q -c 1 -W 1 "'$WAIT_ONLINE_ADDRESS'" >/dev/null; do sleep 1; done' |
1973 | + timeout "$WAIT_ONLINE_TIMEOUT" sh -c 'while ! ping6 -q -c 1 -W 1 "'$WAIT_ONLINE_ADDRESS'" >/dev/null; do sleep 1; done' |
1974 | ;; |
1975 | |
1976 | ifup|iface|interface) |
1977 | up=false |
1978 | if [ -z "$WAIT_ONLINE_IFACE" ]; then |
1979 | - auto_list="$(/sbin/ifquery -X lo --list)" |
1980 | - hotplug_list="$(/sbin/ifquery -X lo --allow=hotplug --list)" |
1981 | + auto_list="$(ifquery -X lo --list)" |
1982 | + hotplug_list="$(ifquery -X lo --allow=hotplug --list)" |
1983 | if [ -n "$auto_list" ]; then |
1984 | for i in $(seq 1 $WAIT_ONLINE_TIMEOUT); do |
1985 | up=true |
1986 | for iface in $auto_list; do |
1987 | - if ! /sbin/ifquery --state $iface >/dev/null; then |
1988 | + if ! ifquery --state $iface >/dev/null; then |
1989 | up=false |
1990 | break |
1991 | fi |
1992 | @@ -51,7 +51,7 @@ ifup|iface|interface) |
1993 | done |
1994 | elif [ -n "$hotplug_list" ]; then |
1995 | for i in $(seq 1 $WAIT_ONLINE_TIMEOUT); do |
1996 | - if [ -n "$(/sbin/ifquery --state $hotplug_list)" ]; then |
1997 | + if [ -n "$(ifquery --state $hotplug_list)" ]; then |
1998 | up=true |
1999 | break |
2000 | fi |
2001 | @@ -62,7 +62,7 @@ ifup|iface|interface) |
2002 | fi |
2003 | else |
2004 | for i in $(seq 1 $WAIT_ONLINE_TIMEOUT); do |
2005 | - if [ -n "$(/sbin/ifquery --state $WAIT_ONLINE_IFACE)" ]; then |
2006 | + if [ -n "$(ifquery --state $WAIT_ONLINE_IFACE)" ]; then |
2007 | up=true |
2008 | break |
2009 | fi |