]> granicus.if.org Git - strace/commit
net: print SO_GET_FILTER in getsockopt
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 9 May 2018 12:44:28 +0000 (12:44 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 9 May 2018 12:44:28 +0000 (12:44 +0000)
commita228405a08f583e34c0e11e4247b2400c6e4168c
tree5e59580fb062a703f27268f4b981fe2afe658dc8
parentb537ddc752ba493a69bd93064d55199624a46a26
net: print SO_GET_FILTER in getsockopt

SO_ATTACH_FILTER and SO_GET_FILTER have the same value; the former
constant is intended for use in setsockopt, and the latter is for
getsockopt.  Handle that the same way as similar SOL_IP/SOL_IPV6 socket
options are handled.

* xlat/getsock_options.in: New file.
* xlat/setsock_options.in: Likewise.
* xlat/sockoptions.in (SO_ATTACH_FILTER): Move to
xlat/setsock_options.in.
* net.c: Include "xlat/setsock_options.h" and "xlat/getsock_options.h".
(print_sockopt_fd_level_name) <case SOL_SOCKET>: Use
getsock_options or setsock_options as auxiliary xlats based on the value
of is_getsockopt flag.
* tests/sock_filter-v.c: Update expected output.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
net.c
tests/sock_filter-v.c
xlat/getsock_options.in [new file with mode: 0644]
xlat/setsock_options.in [new file with mode: 0644]
xlat/sock_options.in