xlat: provide fallback definitions for NETLINK_* constants

As new constants have been added gradually over kernel releases, define
all constant values to make newer constants decoded properly when strace
is built with older kernel headers.

* xlat/netlink_protocols.in: Add default values for constants.
* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove.
* socketutils.c: Likewise.
This commit is contained in:
Дмитрий Левин 2016-12-14 08:09:10 +00:00
parent 76d4eee640
commit 3a838cd31a
3 changed files with 21 additions and 29 deletions

4
net.c
View File

@ -80,10 +80,6 @@
#include "xlat/socketlayers.h"
#include "xlat/inet_protocols.h"
#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG
# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG
#endif
#include "xlat/netlink_protocols.h"
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H

View File

@ -38,10 +38,6 @@
#include <linux/rtnetlink.h>
#include "xlat/netlink_protocols.h"
#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG
# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG
#endif
#include <sys/un.h>
#ifndef UNIX_PATH_MAX
# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path)

View File

@ -1,21 +1,21 @@
NETLINK_ROUTE
NETLINK_UNUSED
NETLINK_USERSOCK
NETLINK_FIREWALL
NETLINK_SOCK_DIAG
NETLINK_NFLOG
NETLINK_XFRM
NETLINK_SELINUX
NETLINK_ISCSI
NETLINK_AUDIT
NETLINK_FIB_LOOKUP
NETLINK_CONNECTOR
NETLINK_NETFILTER
NETLINK_IP6_FW
NETLINK_DNRTMSG
NETLINK_KOBJECT_UEVENT
NETLINK_GENERIC
NETLINK_SCSITRANSPORT
NETLINK_ECRYPTFS
NETLINK_RDMA
NETLINK_CRYPTO
NETLINK_ROUTE 0
NETLINK_UNUSED 1
NETLINK_USERSOCK 2
NETLINK_FIREWALL 3
NETLINK_SOCK_DIAG 4
NETLINK_NFLOG 5
NETLINK_XFRM 6
NETLINK_SELINUX 7
NETLINK_ISCSI 8
NETLINK_AUDIT 9
NETLINK_FIB_LOOKUP 10
NETLINK_CONNECTOR 11
NETLINK_NETFILTER 12
NETLINK_IP6_FW 13
NETLINK_DNRTMSG 14
NETLINK_KOBJECT_UEVENT 15
NETLINK_GENERIC 16
NETLINK_SCSITRANSPORT 18
NETLINK_ECRYPTFS 19
NETLINK_RDMA 20
NETLINK_CRYPTO 21