commit:     486214bb2d772c9316d7a8e6917a70e4a7405381
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 23 22:39:27 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Oct 23 22:39:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=486214bb

iproute2: errorcheck on netmasks.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net/iproute2.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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*)

Reply via email to