From 8bb4b759eb23004e8c6d5f9e267854624c70e354 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 21 Dec 2011 08:03:38 +0000 Subject: net/iproute2: IPv6 cannot be used with broadcast Broadcast and IPv6 should not be used together. Do not try to set the keyword for auto-generation of the broadcast address. If the user passes a broadcast address for IPv6, throw an error. Signed-off-by: Robin H. Johnson --- net/iproute2.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'net/iproute2.sh') diff --git a/net/iproute2.sh b/net/iproute2.sh index c3bb9c8c..4c7fbdc5 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -137,8 +137,14 @@ _add_address() fi # figure out the broadcast address if it is not specified - # FIXME: I'm not sure if this should be set if we are passing a peer arg - [ -z "$broadcast" ] && broadcast="+" + # This must NOT be set for IPv6 addresses + if [ "${address/:}" = "${address}" ]; then + # FIXME: I'm not sure if this should be set if we are passing a peer arg + [ -z "$broadcast" ] && broadcast="+" + elif [ -n "$broadcast" ]; then + eerror "Broadcast keywords are not valid with IPv6 addresses" + return 1 + fi # This must appear on a single line, continuations cannot be used 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 -- cgit v1.2.3