xlat: treat socketlayers as a sorted array

* xlat/socketlayers.in: Add a comment that the xlat is sorted.
* net.c (print_sockopt_fd_level_name): Use printxval_search
instead of printxval for decoding socket layer name.
This commit is contained in:
Eugene Syromyatnikov 2018-04-11 16:32:30 +02:00 committed by Dmitry V. Levin
parent 02114f254c
commit 77fef8df57
2 changed files with 2 additions and 1 deletions

2
net.c
View File

@ -400,7 +400,7 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
{
printfd(tcp, fd);
tprints(", ");
printxval(socketlayers, level, "SOL_??");
printxval_search(socketlayers, level, "SOL_??");
tprints(", ");
switch (level) {

View File

@ -1,3 +1,4 @@
/* sort -k2,2n */
SOL_IP 0
#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__)
SOL_SOCKET 1