examples/ip_frag: check for non-existent ports
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit is contained in:
parent
240952a9e5
commit
eaa8d3bf6d
@ -886,6 +886,10 @@ MAIN(int argc, char **argv)
|
|||||||
if (init_mem() < 0)
|
if (init_mem() < 0)
|
||||||
rte_panic("Cannot initialize memory structures!\n");
|
rte_panic("Cannot initialize memory structures!\n");
|
||||||
|
|
||||||
|
/* check if portmask has non-existent ports */
|
||||||
|
if (enabled_port_mask & ~(RTE_LEN2MASK(nb_ports, unsigned)))
|
||||||
|
rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n");
|
||||||
|
|
||||||
/* initialize all ports */
|
/* initialize all ports */
|
||||||
for (portid = 0; portid < nb_ports; portid++) {
|
for (portid = 0; portid < nb_ports; portid++) {
|
||||||
/* skip ports that are not enabled */
|
/* skip ports that are not enabled */
|
||||||
|
@ -1093,6 +1093,10 @@ MAIN(int argc, char **argv)
|
|||||||
if (init_mem() < 0)
|
if (init_mem() < 0)
|
||||||
rte_panic("Cannot initialize memory structures!\n");
|
rte_panic("Cannot initialize memory structures!\n");
|
||||||
|
|
||||||
|
/* check if portmask has non-existent ports */
|
||||||
|
if (enabled_port_mask & ~(RTE_LEN2MASK(nb_ports, unsigned)))
|
||||||
|
rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n");
|
||||||
|
|
||||||
/* initialize all ports */
|
/* initialize all ports */
|
||||||
for (portid = 0; portid < nb_ports; portid++) {
|
for (portid = 0; portid < nb_ports; portid++) {
|
||||||
/* skip ports that are not enabled */
|
/* skip ports that are not enabled */
|
||||||
|
Loading…
Reference in New Issue
Block a user