From: Davide Caratti Date: Fri, 9 Sep 2016 14:02:22 +0000 (+0200) Subject: macsec: fix input range of 'icvlen' parameter X-Git-Tag: v4.8.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f20f5f79909fdc6327fcd015a3850645a236729d;p=thirdparty%2Fiproute2.git macsec: fix input range of 'icvlen' parameter 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 Acked-by: Phil Sutter Acked-by: Sabrina Dubroca --- diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c index 2e670e9ec..127fa1e32 100644 --- a/ip/ipmacsec.c +++ b/ip/ipmacsec.c @@ -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); }