]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
macsec: fix input range of 'icvlen' parameter
authorDavide Caratti <dcaratti@redhat.com>
Fri, 9 Sep 2016 14:02:22 +0000 (16:02 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 20 Sep 2016 16:48:26 +0000 (09:48 -0700)
the maximum possible ICV length in a MACsec frame is 16 octects, not 32:
fix get_icvlen() accordingly, so that a proper error message is displayed
in case input 'icvlen' is greater than 16.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
ip/ipmacsec.c

index 2e670e9ecab9d6cc0b9f074d92a12e31281686eb..127fa1e32bd1182e3227d7ec9c9ad9528a560737 100644 (file)
@@ -152,9 +152,9 @@ static void get_icvlen(__u8 *icvlen, char *arg)
        if (ret)
                invarg("expected ICV length", arg);
 
-       if (*icvlen < MACSEC_MIN_ICV_LEN || *icvlen > MACSEC_MAX_ICV_LEN)
+       if (*icvlen < MACSEC_MIN_ICV_LEN || *icvlen > MACSEC_STD_ICV_LEN)
                invarg("ICV length must be in the range {"
-                      STR(MACSEC_MIN_ICV_LEN) ".." STR(MACSEC_MAX_ICV_LEN)
+                      STR(MACSEC_MIN_ICV_LEN) ".." STR(MACSEC_STD_ICV_LEN)
                       "}", arg);
 }