1 |
commit: 8bb4b759eb23004e8c6d5f9e267854624c70e354 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 21 08:03:38 2011 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 21 08:08:31 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8bb4b759 |
7 |
|
8 |
net/iproute2: IPv6 cannot be used with broadcast |
9 |
|
10 |
Broadcast and IPv6 should not be used together. Do not try to set the |
11 |
keyword for auto-generation of the broadcast address. If the user passes |
12 |
a broadcast address for IPv6, throw an error. |
13 |
|
14 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
15 |
|
16 |
--- |
17 |
net/iproute2.sh | 10 ++++++++-- |
18 |
1 files changed, 8 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/net/iproute2.sh b/net/iproute2.sh |
21 |
index c3bb9c8..4c7fbdc 100644 |
22 |
--- a/net/iproute2.sh |
23 |
+++ b/net/iproute2.sh |
24 |
@@ -137,8 +137,14 @@ _add_address() |
25 |
fi |
26 |
|
27 |
# figure out the broadcast address if it is not specified |
28 |
- # FIXME: I'm not sure if this should be set if we are passing a peer arg |
29 |
- [ -z "$broadcast" ] && broadcast="+" |
30 |
+ # This must NOT be set for IPv6 addresses |
31 |
+ if [ "${address/:}" = "${address}" ]; then |
32 |
+ # FIXME: I'm not sure if this should be set if we are passing a peer arg |
33 |
+ [ -z "$broadcast" ] && broadcast="+" |
34 |
+ elif [ -n "$broadcast" ]; then |
35 |
+ eerror "Broadcast keywords are not valid with IPv6 addresses" |
36 |
+ return 1 |
37 |
+ fi |
38 |
|
39 |
# This must appear on a single line, continuations cannot be used |
40 |
set -- "${address}${netmask}" ${peer:+peer} ${peer} ${broadcast:+broadcast} ${broadcast} ${anycast:+anycast} ${anycast} ${label:+label} ${label} ${scope:+scope} ${scope} dev "${IFACE}" ${valid_lft:+valid_lft} $valid_lft ${preferred_lft:+preferred_lft} $preferred_lft $confflaglist |