diff options
author | 2016-10-23 15:39:27 -0700 | |
---|---|---|
committer | 2016-10-23 15:39:27 -0700 | |
commit | 486214bb2d772c9316d7a8e6917a70e4a7405381 (patch) | |
tree | 760a4369078b5fa23fed5c59872dc23c5dbc2ca2 | |
parent | iproute2: add keywords: noprefixroute mngtmpaddr. (diff) | |
download | netifrc-486214bb2d772c9316d7a8e6917a70e4a7405381.tar.gz netifrc-486214bb2d772c9316d7a8e6917a70e4a7405381.tar.bz2 netifrc-486214bb2d772c9316d7a8e6917a70e4a7405381.zip |
iproute2: errorcheck on netmasks.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | net/iproute2.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/iproute2.sh b/net/iproute2.sh index d74bc29..682fdc6 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -115,7 +115,12 @@ _add_address() x=$1 ; shift case "$x" in netmask|ne*) - netmask="/$(_netmask2cidr "$1")" ; shift ;; + netmask="/$(_netmask2cidr "$1")" + if [ "${address/\/}" != "${address}" ]; then + eerror "Too many netmasks: $address netmask $1" + return 1 + fi + shift ;; broadcast|brd|br*) broadcast="$1" ; shift ;; pointopoint|pointtopoint|peer|po*|pe*) |