selftests/net: Refactor xfrm_fill_key() to use array of structs
authorGautam Menghani <gautammenghani201@gmail.com>
Sat, 6 Aug 2022 16:35:30 +0000 (22:05 +0530)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 16 Aug 2022 09:28:13 +0000 (11:28 +0200)
commit93d7c52a6eb93e58e4569bd4de95ba3b19e3cf20
treecb60ea48fd6e0f3ca5a7783b94cb970c5fe9cb25
parent7ebfc85e2cd7b08f518b526173e9a33b56b3913b
selftests/net: Refactor xfrm_fill_key() to use array of structs

A TODO in net/ipsec.c asks to refactor the code in xfrm_fill_key() to
use set/map to avoid manually comparing each algorithm with the "name"
parameter passed to the function as an argument. This patch refactors
the code to create an array of structs where each struct contains the
algorithm name and its corresponding key length.

Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
tools/testing/selftests/net/ipsec.c