From dd772f04fe9bdcd8abd7d8405e6d332f007c2931 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 18 Sep 2017 08:57:50 +0100 Subject: [PATCH] cosmetic: move cidr functions to better place --- weave | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/weave b/weave index 0e1b731e..48406662 100755 --- a/weave +++ b/weave @@ -186,20 +186,6 @@ check_docker_version() { fi } -is_cidr() { - echo "$1" | grep -E "^$CIDR_REGEXP$" >/dev/null -} - -collect_cidr_args() { - CIDR_ARGS="" - CIDR_ARG_COUNT=0 - while [ "$1" = "net:default" ] || is_cidr "$1" || is_cidr "${1#ip:}" || is_cidr "${1#net:}" ; do - CIDR_ARGS="$CIDR_ARGS ${1#ip:}" - CIDR_ARG_COUNT=$((CIDR_ARG_COUNT + 1)) - shift 1 - done -} - ###################################################################### # main ###################################################################### @@ -901,6 +887,20 @@ collect_dns_add_remove_args() { # IP Allocation Management helpers ###################################################################### +is_cidr() { + echo "$1" | grep -E "^$CIDR_REGEXP$" >/dev/null +} + +collect_cidr_args() { + CIDR_ARGS="" + CIDR_ARG_COUNT=0 + while [ "$1" = "net:default" ] || is_cidr "$1" || is_cidr "${1#ip:}" || is_cidr "${1#net:}" ; do + CIDR_ARGS="$CIDR_ARGS ${1#ip:}" + CIDR_ARG_COUNT=$((CIDR_ARG_COUNT + 1)) + shift 1 + done +} + check_overlap() { util_op netcheck $1 $BRIDGE }