]> granicus.if.org Git - strace/commitdiff
net: decode optname argument of [gs]etsockopt for SOL_NETLINK level
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 15 Nov 2017 16:36:21 +0000 (16:36 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 15 Nov 2017 16:36:21 +0000 (16:36 +0000)
* xlat/socknetlinkoptions.in: New file.
* net.c: Include "xlat/socknetlinkoptions.h".
(print_sockopt_fd_level_name) <SOL_NETLINK>: Print name using
socknetlinkoptions.
* NEWS: Metnion this.

NEWS
net.c
xlat/socknetlinkoptions.in [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 859cf9d123814fbd5e2ca137abe97b27e7bc0f60..078449cae1f0c5cd0adf3b6dae838aeb8fd620c7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ Noteworthy changes in release ?.?? (????-??-??)
 
 * Improvements
   * Implemented decoding of netlink descriptor attributes as file descriptors.
+  * Implemented decoding of option name argument of getsockopt and setsockopt
+    syscalls for SOL_NETLINK level.
   * Updated the list of MSG_* constants.
 
 Noteworthy changes in release 4.20 (2017-11-13)
diff --git a/net.c b/net.c
index 34a394dba8f3ee447a865429cda7befdbaf52523..f3c6f6b8114a91a05fe0940f3dd49d95004c0034 100644 (file)
--- a/net.c
+++ b/net.c
@@ -390,8 +390,9 @@ SYS_FUNC(socketpair)
 #include "xlat/getsockipv6options.h"
 #include "xlat/setsockipv6options.h"
 #include "xlat/sockipxoptions.h"
-#include "xlat/sockrawoptions.h"
+#include "xlat/socknetlinkoptions.h"
 #include "xlat/sockpacketoptions.h"
+#include "xlat/sockrawoptions.h"
 #include "xlat/socksctpoptions.h"
 #include "xlat/socktcpoptions.h"
 
@@ -431,6 +432,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
        case SOL_RAW:
                printxval(sockrawoptions, name, "RAW_???");
                break;
+       case SOL_NETLINK:
+               printxval(socknetlinkoptions, name, "NETLINK_???");
+               break;
 
                /* Other SOL_* protocol levels still need work. */
 
diff --git a/xlat/socknetlinkoptions.in b/xlat/socknetlinkoptions.in
new file mode 100644 (file)
index 0000000..033ffd4
--- /dev/null
@@ -0,0 +1,11 @@
+NETLINK_ADD_MEMBERSHIP         1
+NETLINK_DROP_MEMBERSHIP                2
+NETLINK_PKTINFO                        3
+NETLINK_BROADCAST_ERROR                4
+NETLINK_NO_ENOBUFS             5
+NETLINK_RX_RING                        6
+NETLINK_TX_RING                        7
+NETLINK_LISTEN_ALL_NSID                8
+NETLINK_LIST_MEMBERSHIPS       9
+NETLINK_CAP_ACK                        10
+NETLINK_EXT_ACK                        11