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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
* rtnl_link.c (decode_nla_tun_type, decode_ifla_xdp_attached,
decode_ifla_inet_conf, decode_ifla_inet6_flags, decode_ifla_inet6_conf,
decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats,
decode_ifla_inet6_agm): Decrement xlat size by one to account
for XLAT_END as other users of indexed and sorted xlats do.
Fixes: v4.25~71 "rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value"
Fixes: v4.23~41 "rtnl_link: decode IFLA_AF_SPEC"
Fixes: v4.23~37 "rtnl_link: implement IFLA_INFO_DATA for tun devices"
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.
Rename decode_ifla_inet6_token to decode_nla_in6_addr,
add a sister function decode_nla_in_addr for future use.
* nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions.
* nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations.
* rtnl_link.c (decode_ifla_inet6_token): Remove.
(ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr.
Introduced by Linux commit v4.19-rc1~140^2~205^2~1.
* rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>:
New decoder, calls decode_nla_u32.
* xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant.
Introduced by Linux commit v4.19-rc1~140^2~288^2.
* xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New
constant.
* rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>:
New decoder.
* xlat/rtnl_ifla_xdp_attached_mode.in: New file.
* rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h".
(decode_ifla_xdp_attached): New function.
(ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use
decode_ifla_xdp_attached instead of decode_nla_u8.
* tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding.
Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6.
* xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID,
IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants.
* rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for
IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID.
* tests/nlattr_ifla_xdp.c: Add checks for new attributes.
Since it is relatively simple.
* rtnl_link.c (decode_ifla_bridge_id): Provide struct definition for
the id variable.
[!HAVE_STRUCT_IFLA_BRIDGE_ID] (decode_ifla_bridge_id): Decode struct
ifla_bridge_id.
It reduces code duplication somewhat and allows avoiding errors like
the one fixed in the previous commit.
* rtnl_link.c (decode_ifla_protinfo, decode_nla_linkinfo_data_bridge,
decode_nla_linkinfo_data_tun, decode_ifla_linkinfo, decode_ifla_port,
decode_ifla_vf_ports, decode_ifla_xdp,
DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use ARRSZ_PAIR in
decode_nlattr call arguments.
* rtnl_link.c (decode_nla_linkinfo_data_bridge): Change
rtnl_ifla_info_data_bridge_attrs to ifla_info_data_bridge_nla_decoders
in ARRAY_SIZE call.
(decode_nla_linkinfo_data_tun): Change rtnl_ifla_info_data_tun_attrs
to ifla_info_data_tun_nla_decoders in ARRAY_SIZE call.
Fixes: v4.22-328-g1e6d5a8 "rtnl_link: implement IFLA_INFO_DATA for bridges"
Fixes: v4.22-329-g4eab3a4 "rtnl_link: implement IFLA_INFO_DATA for tun devices"
* xlat/rtnl_ifla_info_data_tun_attrs.in: New file.
* xlat/tun_device_types.in: Likewise.
* rtnl_link.c: Include xlat/rtnl_ifla_info_data_tun_attrs.h and
xlat/tun_device_types.h.
(decode_nla_tun_type, decode_nla_linkinfo_data_tun): New functions.
(ifla_info_data_tun_nla_decoders): New decoder dispatcher table.
(decode_nla_linkinfo_data): Use decode_nla_linkinfo_data_tun if kind
is
"tun".
* xlat/rtnl_ifla_info_data_bridge_attrs.in: New file.
* rtnl_link.c: Include xlat/rtnl_ifla_info_data_bridge_attrs.h.
(ifla_info_data_bridge_nla_decoders): New decoder dispatcher table.
(decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data): New
functions.
(ifla_linkinfo_nla_decoders) <IFLA_INFO_DATA>: Use
decode_nla_linkinfo_data as a decoder.
So far, only CAN provides it.
* rtnl_link.c (decode_nla_linkinfo_xstats_can,
decode_nla_linkinfo_xstats): New function.
(ifla_linkinfo_nla_decoders) <IFLA_INFO_XSTATS>: Use
decode_nla_linkinfo_xstats as a decoder.
Dispatch for IFLA_INFO_* attributes should be performed based on the
string provided in a IFLA_INFO_KIND attribute.
* nlattr.h (struct ifla_linkinfo_ctx): New type definition.
* rtnl_link.c (decode_nla_linkinfo_kind): New function.
(ifla_linkinfo_nla_decoders) <IFLA_INFO_KIND>: Use
decode_nla_linkinfo_kind as decoder.
(decode_ifla_linkinfo): Add struct ifla_linkinfo_ctx context, pass it to
the decode_nlattr call as opaque data.
* rtnl_link.c (DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use
PRINT_FIELD_XVAL_SORTED_SIZED instead of PRINT_FIELD_XVAL for
arp_hardware_types.
* sock.c (print_ifreq): Likewise.
* print_mac.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (sprint_mac_addr): New declaration.
(print_mac_addr): New function, a thin wrapper around sprint_mac_addr.
* print_fields.h (PRINT_FIELD_MAC, PRINT_FIELD_MAC_SZ): New macros.
* rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_MAC for bridge
address printing.
* sock.c (print_ifreq) <case SIOCGIFHWADDR>: Use print_mac_addr for
ifr_hwaddr printing.
* sockaddr.c (print_sockaddr_data_bt): Use print_mac_addr for
{sco,rc,l2}_bdaddr field printing.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* rtnl_link.c (decode_ifla_event): New function.
(ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it.
* xlat/rtnl_ifla_events.in: New file.
* NEWS: Mention it.
Enhance runtime detection of struct rtnl_link_stats.rx_nohandler
and struct rtnl_link_stats64.rx_nohandler.
* rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats).
(decode_rtnl_link_stats64): Likewise, so not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats64).
* configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id
and rtnl_link_stats64 structures in <linux/if_link.h>.
* rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h".
(decode_ifla_bridge_id, decode_ifla_protinfo): New functions.
(ifla_brport_nla_decoders): New array.
(ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo.
* xlat/rtnl_ifla_brport_attrs.in: New file.
* configure.ac (AC_CHECK_HEADERS): Add linux/if_link.h.
(AC_CHECK_TYPES): Check for struct rtnl_link_stats64
in <linux/if_link.h>.
(AC_CHECK_MEMBERS): Check for rx_nohandler field
in struct rtnl_link_stats/rtnl_link_stats64.
* rtnl_link.c: Include <linux/if_link.h>.
(decode_rtnl_link_stats, decode_rtnl_link_ifmap,
decode_rtnl_link_stats64): New functions.
(ifinfomsg_nla_decoders): New array.
(decode_ifinfomsg): Use it.
<sys/socket.h> has to be included before <linux/netlink.h> because
the latter used to be incomplete in older kernel headers.
As a local wrapper file called netlink.h was introduced earlier
to workaround this and related portability issues, include it before
<linux/rtnetlink.h> that in turn includes <linux/netlink.h>.
This fixes build on systems with older kernel headers.
* rtnl_link.c: Include "netlink.h" before <linux/rtnetlink.h>.
* netlink_route.h: New file.
* rtnl_link.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* defs.h (arp_hardware_types, iffflags): New xlat prototypes.
* netlink_route.c: Include "netlink_route.h"
and <linux/rtnetlink.h>.
(netlink_route_decoder_t): New typedef.
(route_decoders): New array.
(decode_netlink_route): Use it.
Co-authored-by: Fabien Siron <fabien.siron@epita.fr>