From: Volodymyr Fialko Date: Wed, 9 Feb 2022 11:52:13 +0000 (+0100) Subject: examples/ipsec-secgw: add check for unprotected port mask X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a15f7b7d8aac9cca41d8bd022c3cf939a6a8d2e8;p=dpdk.git examples/ipsec-secgw: add check for unprotected port mask Usage of unprotected port mask without any configured SA inbound, will cause use of uninitialized SA context, so disallow such configuration. Signed-off-by: Volodymyr Fialko Acked-by: Anoob Joseph --- diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 21abc0d251..9de1c6d85c 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -3293,6 +3293,9 @@ main(int32_t argc, char **argv) rte_exit(EXIT_FAILURE, "Invalid unprotected portmask 0x%x\n", unprotected_port_mask); + if (unprotected_port_mask && !nb_sa_in) + rte_exit(EXIT_FAILURE, "Cannot use unprotected portmask without configured SA inbound\n"); + if (check_poll_mode_params(eh_conf) < 0) rte_exit(EXIT_FAILURE, "check_poll_mode_params failed\n");