VPP-408: fix coverity warning in run_ping_ip46_address() 89/2889/1
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 14 Sep 2016 15:51:16 +0000 (15:51 +0000)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 14 Sep 2016 15:51:16 +0000 (15:51 +0000)
commitacfb47d6c10266555272661fcf5e660c99d09545
tree560319b9588062cf66c524dd4743407102cb106b
parent400c1cfc7aaa022e7871ec51a97c530cdac53de8
VPP-408: fix coverity warning in run_ping_ip46_address()

CID 147141: Security best practices violations (DC.WEAK_CRYPTO)
/vnet/vnet/ip/ping.c: 496 in run_ping_ip46_address()
490 ping_main_t *pm = &ping_main;
491 uword curr_proc = vlib_current_process (vm);
492 u32 n_replies = 0;
493 u32 n_requests = 0;
494 ping_run_t *pr = 0;
495 u32 ping_run_index = 0;
CID 147141: Security best practices violations (DC.WEAK_CRYPTO)
"rand" should not be used for security related applications, as linear congruential algorithms are too easy to break.
496 u16 icmp_id = rand ();
497 while (hash_get (pm->ping_run_by_icmp_id, icmp_id))
498 { 499 vlib_cli_output (vm, "ICMP ID collision at %d, incrementing", icmp_id); 500 icmp_id++; 501 }

Change-Id: I822350c03afce0b2dd35f37e27f55df82ca3443f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
vnet/vnet/ip/ping.c