]> git.droids-corp.org - dpdk.git/blobdiff - examples/ipsec-secgw/sa.c
examples/ipsec-secgw: fix corner case for SPI value
[dpdk.git] / examples / ipsec-secgw / sa.c
index 1ae4e2a9c507dcf4c87da62f92a14c0050319480..25ceea179dfa1820b59334fbc2db7ec3bd16fcd6 100644 (file)
@@ -240,6 +240,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
        APP_CHECK_TOKEN_IS_NUM(tokens, 1, status);
        if (status->status < 0)
                return;
+       if (atoi(tokens[1]) == INVALID_SPI)
+               return;
        rule->spi = atoi(tokens[1]);
 
        for (ti = 2; ti < n_tokens; ti++) {