examples/ipsec-secgw: fix corner case for SPI value
[dpdk.git] / examples / ipsec-secgw / sa.c
index 1ae4e2a..25ceea1 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++) {