IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
* net.c (ax25_protocols): Decrement xlat size by one to account
for XLAT_END as other users of sorted xlats do.
Fixes: v4.25~28 "net: add support for AX.25 protocols and socket option names decoding"
* net.c (print_get_error): New function decoding error
number returned as option value for SO_ERROR option.
(print_getsockopt) <case SO_ERROR>: Call print_get_error.
* tests/so_error.c: New test.
* tests/gen_tests.in (so_error): Likewise.
* tests/pure_executables.list: Add so_error.
* tests/.gitignore: Likewise.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
strace is now provided under the terms of the GNU Lesser General
Public License version 2.1 or later, see COPYING for more details.
strace test suite is now provided under the terms of the GNU General
Public License version 2 or later, see tests/COPYING for more details.
* xlat/ax25_protocols.in: New file.
* xlat/sock_ax25_options.in: Likewise.
* net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h".
* (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
ax25_protocols xlat.
(print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
using sock_ax25_options xlat.
* net.c (print_tpacket_stats): Change decoder to match the kernel
behaviour: getsockopt syscall accepts any non-negative *optlen and
writes either MIN(sizeof(struct tpacket_stats), *optlen) or
MIN(sizeof(struct tpacket_stats_v3), *optlen) bytes of data.
* net.c: Remove checks for SO_PEERCRED, SO_ATTACH_FILTER, and
SO_ATTACH_REUSEPORT_CBPF macros as they are defined unconditionally
since commit v4.23~199.
* net.c (print_ucred): Rename to print_get_ucred, change decoder
to match the kernel behaviour: getsockopt syscall accepts any
non-negative *optlen and writes MIN(sizeof(struct ucred), *optlen)
bytes of data.
(print_getsockopt): Replace print_ucred with print_get_ucred.
* tests/so_percred.c: Include <string.h>.
(main): Update expected output.
* net.c (print_get_linger): Change decoder to match the kernel
behaviour: getsockopt syscall accepts any non-negative *optlen
and writes MIN(sizeof(struct linger), *optlen) bytes of data.
(print_set_linger): Move after definition of SYS_FUNC(getsockopt).
* tests/so_linger.c: Include <stddef.h> and <string.h>.
(main): Update expected output.
* net.c (print_getsockopt): Apply (ulen < 0 || rlen < 0) check for all
cases. As the kernel neither accepts nor returns a negative length
in case of successful getsockopt syscall invocation, these negative
values must have been forged by userspace.
Define SO_TIMESTAMP twice, for PA-RISC and all the other architectures.
* xlat/sock_rds_options.in [!__hppa__] (SO_TIMESTAMP): Define to 29.
[__hppa__] (SO_TIMESTAMP): Define to 0x4012.
* net.c (print_sockopt_fd_level_name) <case SOL_RDS>: Use
printxval_search instead of printxval.
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>
Such names as sockrxrpcoptions are incomprehensible.
* xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in.
* xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in.
* xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in.
* xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in.
* xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in.
* xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in.
* xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in.
* xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in.
* xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in.
* xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in.
* xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in.
* xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in.
* xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in.
* xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in.
* xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in.
* xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in.
* xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in.
* xlat/sockoptions.in: Rename to xlat/sock_options.in.
* xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in.
* xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in.
* xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in.
* xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in.
* xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in.
* xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in.
* xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in.
* xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in.
* xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in.
* xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in.
* xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in.
* net.c: Update.
There is no need to provide duplicate fallback definitions anymore,
inclusion of the appropriate xlat header in XLAT_MACROS_ONLY mode
does the right thing.
* btrfs.c [!BTRFS_FIRST_FREE_OBJECTID] (BTRFS_FIRST_FREE_OBJECTID):
Remove, a fallback definition is already provided by included
"xlat/btrfs_tree_objectids.h".
* net.c: Include "xlat/addrfams.h" in XLAT_MACROS_ONLY mode.
[!AF_BLUETOOTH] (AF_BLUETOOTH): Remove.
* syscall.c: Include "xlat/nt_descriptor_types.h" in XLAT_MACROS_ONLY
mode.
[!NT_PRSTATUS] (NT_PRSTATUS): Remove.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* 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.
As we have all BTPROTO_* constant definitions now, there is no need
to rely on bluetooth.h header anymore.
* net.c (AF_BLUETOOTH): Provide a fallback definition.
[HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include <bluetooth/bluetooth.h>.
[!HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h".
[!HAVE_BLUETOOTH_BLUETOOTH_H] (decode_sockbuf): Decode AF_BLUETOOTH.
(decode_sockbuf) <case AF_BLUETOOTH>: Use printxval_index.
* xlat/bt_protocols.in: Add "#value_indexed" directive.
NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests
not just a single integer but an array of integers. The kernel also
supports a zero optlen NETLINK_LIST_MEMBERSHIPS request.
* net.c (print_uint32): New function.
(print_getsockopt): Add ulen argument, rename len argument to rlen,
<SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array
and print_uint32.
(SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt.
* tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS
decoding.
Tweak the parser to follow the kernel behaviour.
* net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and
print returned value as integer iff the length is >= sizeof(int),
otherwise print the address.
* NEWS: Mention this.
* 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.
The size of struct group_req depends on alignment of long and therefore
has to be mpersified.
* print_group_req.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* net.c (print_group_req): Move to print_group_req.c, wrap into
MPERS_PRINTER_DECL.
* net.c (print_group_req): Allow option length greater than
sizeof(struct group_req) to match the kernel behaviour.
When the option length is invalid, print the address.
* NEWS: Mention this.
As multicast socket options are shared between IPv4 and IPv6,
they should be decoded both for SOL_IP and SOL_IPV6.
* net.c (print_setsockopt) <SOL_IPV6> [MCAST_JOIN_GROUP]: Handle
MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP.
* net.c (print_mreq, print_mreq6): Treat negative option length
as invalid to match the kernel behaviour. When the option length
is invalid, print the address.
* NEWS: Mention it.
* tests/ip_mreq.c (main): Check it. Update expected output.
* print_fields.h (PRINT_FIELD_SOCKADDR): New macro.
* msghdr.c (print_cmsg_ip_recverr): Use it instead of print_sockaddr.
* net.c (print_group_req): Likewise.
* sock.c (PRINT_IFREQ_ADDR): Remove.
(print_ifreq, print_ifconf_ifreq): Use PRINT_FIELD_SOCKADDR
instead of PRINT_IFREQ_ADDR.
print_sockaddr does not use its first argument, remove it.
* defs.h (print_sockaddr): Remove argument.
* sockaddr.c (print_sockaddr): Remove argument. All callers updated.
* sock.c (PRINT_IFREQ_ADDR): Likewise.
* net.c (print_tpacket_stats, print_tpacket_req): Use PRINT_FIELD_U.
(print_group_req): Use PRINT_FIELD_IFINDEX.
(print_packet_mreq): Use PRINT_FIELD_IFINDEX, PRINT_FIELD_U,
and PRINT_FIELD_XVAL.
* bpf_sock_filter.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/skf_ad.in: New file.
* defs.h (decode_sock_fprog, print_sock_fprog): New prototypes.
* fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer.
* net.c (print_getsockopt): Use decode_sock_fprog to print
socket filter programs for SO_GET_FILTER socket option.
(print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size
to print socket filter programs for SO_ATTACH_FILTER
and SO_ATTACH_REUSEPORT_CBPF socket options.
* NEWS: Mention this.
* net.c (print_linger): Rename to print_set_linger.
(print_setsockopt): Replace print_linger with print_set_linger.
(print_get_linger): New function that accepts arbitrary option length
to match the kernel behaviour.
(print_getsockopt): Replace print_linger with print_get_linger.
* NEWS: Mention this.
As the last argument of getsockopt syscall has read-write semantics,
print both user and kernel values when they differ.
* net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save
the length specified to the kernel. On error, print the length saved
on entering. When the saved length and the length returned by the
kernel differ, print both values.
* NEWS: Mention this.
* tests/net-icmp_filter.c (main): Update expected output.