1
0
mirror of https://github.com/systemd/systemd synced 2026-02-25 16:54:44 +01:00

Compare commits

..

No commits in common. "e48b6fca76ae1105e6305b3f3c1c15c4c42639ef" and "04d2a86e6600620880495c136a67330dda9d26bd" have entirely different histories.

31 changed files with 99 additions and 465 deletions

26
NEWS
View File

@ -64,14 +64,6 @@ CHANGES WITH 260 in spe:
directory or not, we make use of it unconditionally and have dropped
support for the old way using protofiles.
* The org.systemd.login1.Manager D-Bus interface has a minor API break.
The `CanPowerOff()`, `CanReboot()`, `CanSuspend()`, etc. family of
methods have introduced new return values which may break downstream
consumers, such as desktop environments. The new return values more
precisely communicate the status of inhibitors. This allows desktops
to differentiate between system administrator policy and
temporary restrictions imposed by inhibitors.
New system interfaces and components:
* The os-release(3) gained a new field FANCY_NAME= that is similar
@ -123,9 +115,6 @@ CHANGES WITH 260 in spe:
* SetProperties() D-Bus method now has a Varlink counterpart. For now,
it only supports setting the Markers= property.
* New 'needs-start' and 'needs-stop' settings are now supported for the
Markers= property.
Changes in udev:
* Permissions for /dev/ptp* are now set to 0664 (previously 0660),
@ -149,18 +138,6 @@ CHANGES WITH 260 in spe:
low brightness values at runtime independently of the systemd clamp
which only applies during boot.
* A new variable ID_INTEGRATION is now exposed to devices that have
ID_BUS defined. This variable can be set to internal when the device
is integral part of the system or external otherwise. Actually,
internal buses like PCI, I2C, SPI... makes it to be internal and
external buses like bluetooth set it to external, while for USB the
removable attribute of the port the device is connected tells us to
decide, fixed is set to internal and removable or unknown to external.
* ID_INPUT_JOYSTICK_INTEGRATION variable has been dropped in favor of
ID_INTEGRATION because it was never used and the new variable cover
better the idea that variable was intended for.
Changes in systemd-networkd:
* MultiPathRoute= option now supports interface-bound ECMP routes.
@ -201,9 +178,6 @@ CHANGES WITH 260 in spe:
* resolvectl now uses varlink to connect to systemd-resolved.
* systemd-resolved now supports ifindex=0 in the BrowseServices IPC API,
to allow browsing all mDNS interfaces in one call.
Changes in other components:
* systemd-repart gained basic support for integrity checks of encrypted

View File

@ -26,10 +26,10 @@
#
# Permitted keys:
# Specify if a joystick is a built-in one or external:
# ID_INTEGRATION=internal|external
# ID_INPUT_JOYSTICK_INTEGRATION=internal|external
#
# If the property is missing, user-space can assume:
# ID_INTEGRATION=external
# ID_INPUT_JOYSTICK_INTEGRATION=external
#
# By default i8042, i2c, and rmi devices are assumed to be internal,
# bluetooth devices are assumed to be external, usb devices are assumed
@ -38,4 +38,4 @@
# Example entry; vid: ffff, pid: 0000; both must be lowercase.
# this will make this usb joystick to behave as internal.
#joystick:usb:vffffp0000*
# ID_INTEGRATION=internal
# ID_INPUT_JOYSTICK_INTEGRATION=internal

View File

@ -183,7 +183,7 @@ def property_grammar():
('ID_MM_DEVICE_IGNORE', Or((Literal('0'), Literal('1')))),
('ID_NET_AUTO_LINK_LOCAL_ONLY', Or((Literal('0'), Literal('1')))),
('POINTINGSTICK_SENSITIVITY', INTEGER),
('ID_INTEGRATION', Or(('internal', 'external'))),
('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))),
('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))),
('XKB_FIXED_LAYOUT', xkb_setting),
('XKB_FIXED_VARIANT', xkb_setting),

View File

@ -276,6 +276,7 @@ node /org/freedesktop/login1 {
readonly t RuntimeDirectoryInodesMax = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t InhibitorsMax = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t NCurrentInhibitors = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t SessionsMax = ...;
@ -710,19 +711,12 @@ node /org/freedesktop/login1 {
<function>CanRebootParameter()</function>, <function>CanRebootToFirmwareSetup()</function>,
<function>CanRebootToBootLoaderMenu()</function>, and <function>CanRebootToBootLoaderEntry()</function>
test whether the system supports the respective operation and whether the calling user is allowed to
execute it. Returns one of <literal>na</literal>, <literal>yes</literal>, <literal>no</literal>,
<literal>challenge</literal>, and <literal>inhibited</literal>. If <literal>na</literal> is returned,
the operation is not available because hardware, kernel, or drivers do not support it. If <literal>yes</literal>
is returned, the operation is supported and the user may execute the operation without further authentication.
If <literal>no</literal> is returned, the operation is available but the user is not allowed to execute
the operation. If <literal>challenge</literal> is returned, the operation is available but only after
authorization. If <literal>inhibited</literal> is returned, the operation is normally available without
authorization but is currently inhibited. The operation is available only if inhibitors are ignored and
after authorization. If <literal>inhibitor-blocked</literal> is returned, the operation is normally
available without authorization but is currently inhibited. While the inhibitor remains active, the user
is not allowed to execute the operation. <literal>challenge-inhibitor-blocked</literal> is similar:
the operation is normally available after authorization but a held inhibitor disallows the user from
executing the operation.</para>
execute it. Returns one of <literal>na</literal>, <literal>yes</literal>, <literal>no</literal>, and
<literal>challenge</literal>. If <literal>na</literal> is returned, the operation is not available because
hardware, kernel, or drivers do not support it. If <literal>yes</literal> is returned, the operation is
supported and the user may execute the operation without further authentication. If <literal>no</literal>
is returned, the operation is available but the user is not allowed to execute the operation. If
<literal>challenge</literal> is returned, the operation is available but only after authorization.</para>
<para><function>ScheduleShutdown()</function> schedules a shutdown operation <varname>type</varname> at
time <varname>usec</varname> in microseconds since the UNIX epoch. Alternatively, if

View File

@ -16,7 +16,10 @@ ENV{ID_BUS}=="bluetooth", ENV{ID_INTEGRATION}="external"
ENV{ID_BUS}=="usb", DRIVERS=="usb", ATTRS{maxchild}=="0", ATTRS{removable}=="fixed", ENV{ID_INTEGRATION}="internal"
ENV{ID_BUS}=="usb", DRIVERS=="usb", ATTRS{maxchild}=="0", ATTRS{removable}=="removable|unknown", ENV{ID_INTEGRATION}="external"
# libinput compatibility, must be loaded before 70-touchpad.rules to allow hwdb quirks to override.
# libinput compatibility variables, must be loaded before 70-(joystick|touchpad).rules to allow hwdb quirks to override.
ENV{ID_INPUT}=="", GOTO="integration_libinput_end"
ENV{ID_INPUT_JOYSTICK}=="1", ENV{ID_INPUT_JOYSTICK_INTEGRATION}="$env{ID_INTEGRATION}"
ENV{ID_INPUT_TOUCHPAD}=="1", ENV{ID_INPUT_TOUCHPAD_INTEGRATION}="$env{ID_INTEGRATION}"
LABEL="integration_libinput_end"
LABEL="integration_end"

View File

@ -8,4 +8,9 @@ KERNEL!="event*", GOTO="joystick_end"
KERNELS=="input*", ENV{ID_BUS}!="", \
IMPORT{builtin}="hwdb 'joystick:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'"
# Spread the hwdb override to ID_INTEGRATION, in the future we could remove the
# joystick hwdb entirely or retain it using the generic ID_INTEGRATION instead
# specific ID_INPUT_JOYSTICK_INTEGRATION.
ENV{ID_INPUT_JOYSTICK_INTEGRATION}!="", ENV{ID_INTEGRATION}="$env{ID_INPUT_JOYSTICK_INTEGRATION}"
LABEL="joystick_end"

View File

@ -14,7 +14,7 @@ ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT"
ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}"
{% if HAVE_ACL %}
TAG=="uaccess|xaccess-*", ENV{MAJOR}!="", RUN{builtin}+="uaccess"
TAG=="uaccess|xaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess"
{% endif %}
LABEL="seat_late_end"

View File

@ -80,7 +80,6 @@ NAME_TO_MAGIC = {
'nsfs': ['NSFS_MAGIC'],
'ntfs': ['NTFS_SB_MAGIC'],
'ntfs3': ['NTFS3_SUPER_MAGIC'],
'nullfs': ['NULL_FS_MAGIC'],
'ocfs2': ['OCFS2_SUPER_MAGIC'],
'openpromfs': ['OPENPROM_SUPER_MAGIC'],
'orangefs': ['ORANGEFS_DEVREQ_MAGIC'],

View File

@ -3,16 +3,12 @@
set -eu
set -o pipefail
# In kernel's arch/parisc/include/uapi/asm/errno.h, The following aliases are defined:
# ECANCELLED → ECANCELED
# EREFUSED → ECONNREFUSED
# EFSBADCRC → EBADMSG
# EFSCORRUPTED → EUCLEAN
# Let's drop them.
# In kernel's arch/parisc/include/uapi/asm/errno.h, ECANCELLED and EREFUSED are defined as aliases of
# ECANCELED and ECONNREFUSED, respectively. Let's drop them.
CC=${1:?}
shift
$CC -dM -include errno.h "$@" - </dev/null | \
grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED|EFSBADCRC|EFSCORRUPTED)' | \
grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED)' | \
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'

View File

@ -119,14 +119,6 @@ enum bpf_cgroup_iter_order {
BPF_CGROUP_ITER_DESCENDANTS_PRE, /* walk descendants in pre-order. */
BPF_CGROUP_ITER_DESCENDANTS_POST, /* walk descendants in post-order. */
BPF_CGROUP_ITER_ANCESTORS_UP, /* walk ancestors upward. */
/*
* Walks the immediate children of the specified parent
* cgroup_subsys_state. Unlike BPF_CGROUP_ITER_DESCENDANTS_PRE,
* BPF_CGROUP_ITER_DESCENDANTS_POST, and BPF_CGROUP_ITER_ANCESTORS_UP
* the iterator does not include the specified parent as one of the
* returned iterator elements.
*/
BPF_CGROUP_ITER_CHILDREN,
};
union bpf_iter_link_info {
@ -926,16 +918,6 @@ union bpf_iter_link_info {
* Number of bytes read from the stream on success, or -1 if an
* error occurred (in which case, *errno* is set appropriately).
*
* BPF_PROG_ASSOC_STRUCT_OPS
* Description
* Associate a BPF program with a struct_ops map. The struct_ops
* map is identified by *map_fd* and the BPF program is
* identified by *prog_fd*.
*
* Return
* 0 on success or -1 if an error occurred (in which case,
* *errno* is set appropriately).
*
* NOTES
* eBPF objects (maps and programs) can be shared between processes.
*
@ -992,7 +974,6 @@ enum bpf_cmd {
BPF_PROG_BIND_MAP,
BPF_TOKEN_CREATE,
BPF_PROG_STREAM_READ_BY_FD,
BPF_PROG_ASSOC_STRUCT_OPS,
__MAX_BPF_CMD,
};
@ -1153,7 +1134,6 @@ enum bpf_attach_type {
BPF_NETKIT_PEER,
BPF_TRACE_KPROBE_SESSION,
BPF_TRACE_UPROBE_SESSION,
BPF_TRACE_FSESSION,
__MAX_BPF_ATTACH_TYPE
};
@ -1393,8 +1373,6 @@ enum {
BPF_NOEXIST = 1, /* create new element if it didn't exist */
BPF_EXIST = 2, /* update existing element */
BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
BPF_F_CPU = 8, /* cpu flag for percpu maps, upper 32-bit of flags is a cpu number */
BPF_F_ALL_CPUS = 16, /* update value across all CPUs for percpu maps */
};
/* flags for BPF_MAP_CREATE command */
@ -1916,12 +1894,6 @@ union bpf_attr {
__u32 prog_fd;
} prog_stream_read;
struct {
__u32 map_fd;
__u32 prog_fd;
__u32 flags;
} prog_assoc_struct_ops;
} __attribute__((aligned(8)));
/* The description below is an attempt at providing documentation to eBPF

View File

@ -334,7 +334,6 @@ struct btrfs_ioctl_fs_info_args {
#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
#define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
#define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
#define BTRFS_FEATURE_INCOMPAT_REMAP_TREE (1ULL << 17)
struct btrfs_ioctl_feature_flags {
__u64 compat_flags;

View File

@ -72,9 +72,6 @@
/* Tracks RAID stripes in block groups. */
#define BTRFS_RAID_STRIPE_TREE_OBJECTID 12ULL
/* Holds details of remapped addresses after relocation. */
#define BTRFS_REMAP_TREE_OBJECTID 13ULL
/* device stats in the device tree */
#define BTRFS_DEV_STATS_OBJECTID 0ULL
@ -281,10 +278,6 @@
#define BTRFS_RAID_STRIPE_KEY 230
#define BTRFS_IDENTITY_REMAP_KEY 234
#define BTRFS_REMAP_KEY 235
#define BTRFS_REMAP_BACKREF_KEY 236
/*
* Records the overall state of the qgroups.
* There's only one instance of this key present,
@ -717,12 +710,9 @@ struct btrfs_super_block {
__u8 metadata_uuid[BTRFS_FSID_SIZE];
__u64 nr_global_roots;
__le64 remap_root;
__le64 remap_root_generation;
__u8 remap_root_level;
/* Future expansion */
__u8 reserved[199];
__le64 reserved[27];
__u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
@ -1167,15 +1157,12 @@ struct btrfs_dev_replace_item {
#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
#define BTRFS_BLOCK_GROUP_RAID1C3 (1ULL << 9)
#define BTRFS_BLOCK_GROUP_RAID1C4 (1ULL << 10)
#define BTRFS_BLOCK_GROUP_REMAPPED (1ULL << 11)
#define BTRFS_BLOCK_GROUP_METADATA_REMAP (1ULL << 12)
#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
BTRFS_SPACE_INFO_GLOBAL_RSV)
#define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \
BTRFS_BLOCK_GROUP_SYSTEM | \
BTRFS_BLOCK_GROUP_METADATA | \
BTRFS_BLOCK_GROUP_METADATA_REMAP)
BTRFS_BLOCK_GROUP_METADATA)
#define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \
BTRFS_BLOCK_GROUP_RAID1 | \
@ -1228,14 +1215,6 @@ struct btrfs_block_group_item {
__le64 flags;
} __attribute__ ((__packed__));
struct btrfs_block_group_item_v2 {
__le64 used;
__le64 chunk_objectid;
__le64 flags;
__le64 remap_bytes;
__le32 identity_remap_count;
} __attribute__ ((__packed__));
struct btrfs_free_space_info {
__le32 extent_count;
__le32 flags;
@ -1340,13 +1319,4 @@ struct btrfs_verity_descriptor_item {
__u8 encryption;
} __attribute__ ((__packed__));
/*
* For a range identified by a BTRFS_REMAP_KEY item in the remap tree, gives
* the address that the start of the range will get remapped to. This
* structure is also shared by BTRFS_REMAP_BACKREF_KEY.
*/
struct btrfs_remap_item {
__le64 address;
} __attribute__ ((__packed__));
#endif /* _BTRFS_CTREE_H_ */

View File

@ -15,10 +15,11 @@
#define _LINUX_ETHTOOL_H
#include <linux/const.h>
#include <linux/typelimits.h>
#include <linux/types.h>
#include <linux/if_ether.h>
#include <limits.h> /* for INT_MAX */
/* All structures exposed to userland should be defined such that they
* have the same layout for 32-bit and 64-bit userland.
*/
@ -600,8 +601,6 @@ enum ethtool_link_ext_state {
ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
ETHTOOL_LINK_EXT_STATE_OVERHEAT,
ETHTOOL_LINK_EXT_STATE_MODULE,
ETHTOOL_LINK_EXT_STATE_OTP_SPEED_VIOLATION,
ETHTOOL_LINK_EXT_STATE_BMC_REQUEST_DOWN,
};
/* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */
@ -1093,20 +1092,13 @@ enum ethtool_module_fw_flash_status {
* struct ethtool_gstrings - string set for data tagging
* @cmd: Command number = %ETHTOOL_GSTRINGS
* @string_set: String set ID; one of &enum ethtool_stringset
* @len: Number of strings in the string set
* @len: On return, the number of strings in the string set
* @data: Buffer for strings. Each string is null-padded to a size of
* %ETH_GSTRING_LEN.
*
* Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
* the string set. They must allocate a buffer of the appropriate
* size immediately following this structure.
*
* Setting @len on input is optional (though preferred), but must be zeroed
* otherwise.
* When set, @len will return the requested count if it matches the actual
* count; otherwise, it will be zero.
* This prevents issues when the number of strings is different than the
* userspace allocation.
*/
struct ethtool_gstrings {
__u32 cmd;
@ -1183,20 +1175,13 @@ struct ethtool_test {
/**
* struct ethtool_stats - device-specific statistics
* @cmd: Command number = %ETHTOOL_GSTATS
* @n_stats: Number of statistics
* @n_stats: On return, the number of statistics
* @data: Array of statistics
*
* Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
* number of statistics that will be returned. They must allocate a
* buffer of the appropriate size (8 * number of statistics)
* immediately following this structure.
*
* Setting @n_stats on input is optional (though preferred), but must be zeroed
* otherwise.
* When set, @n_stats will return the requested count if it matches the actual
* count; otherwise, it will be zero.
* This prevents issues when the number of stats is different than the
* userspace allocation.
*/
struct ethtool_stats {
__u32 cmd;
@ -2203,7 +2188,6 @@ enum ethtool_link_mode_bit_indices {
#define SPEED_40000 40000
#define SPEED_50000 50000
#define SPEED_56000 56000
#define SPEED_80000 80000
#define SPEED_100000 100000
#define SPEED_200000 200000
#define SPEED_400000 400000
@ -2214,7 +2198,7 @@ enum ethtool_link_mode_bit_indices {
static __inline__ int ethtool_validate_speed(__u32 speed)
{
return speed <= __KERNEL_INT_MAX || speed == (__u32)SPEED_UNKNOWN;
return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
}
/* Duplex, half or full. */

View File

@ -249,7 +249,6 @@ struct file_attr {
#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */
#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */
#define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */
#define FS_XFLAG_VERITY 0x00020000 /* fs-verity enabled */
#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
/* the read-only stuff doesn't really belong here, but any other place is

View File

@ -1441,7 +1441,6 @@ enum {
IFLA_GENEVE_DF,
IFLA_GENEVE_INNER_PROTO_INHERIT,
IFLA_GENEVE_PORT_RANGE,
IFLA_GENEVE_GRO_HINT,
__IFLA_GENEVE_MAX
};
#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)

View File

@ -104,6 +104,5 @@
#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
#define PID_FS_MAGIC 0x50494446 /* "PIDF" */
#define GUEST_MEMFD_MAGIC 0x474d454d /* "GMEM" */
#define NULL_FS_MAGIC 0x4E554C4C /* "NULL" */
#endif /* __LINUX_MAGIC_H__ */

View File

@ -39,9 +39,6 @@ enum {
#define MPOL_MODE_FLAGS \
(MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES | MPOL_F_NUMA_BALANCING)
/* Whether the nodemask is specified by users */
#define MPOL_USER_NODEMASK_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
/* Flags for get_mempolicy */
#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
#define MPOL_F_ADDR (1<<1) /* look up vma using address */

View File

@ -61,8 +61,7 @@
/*
* open_tree() flags.
*/
#define OPEN_TREE_CLONE (1 << 0) /* Clone the target tree and attach the clone */
#define OPEN_TREE_NAMESPACE (1 << 1) /* Clone the target tree into a new mount namespace */
#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */
#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
/*
@ -198,10 +197,7 @@ struct statmount {
*/
struct mnt_id_req {
__u32 size;
union {
__u32 mnt_ns_fd;
__u32 mnt_fd;
};
__u32 mnt_ns_fd;
__u64 mnt_id;
__u64 param;
__u64 mnt_ns_id;
@ -236,9 +232,4 @@ struct mnt_id_req {
#define LSMT_ROOT 0xffffffffffffffff /* root mount */
#define LISTMOUNT_REVERSE (1 << 0) /* List later mounts first */
/*
* @flag bits for statmount(2)
*/
#define STATMOUNT_BY_FD 0x00000001U /* want mountinfo for given fd */
#endif /* _LINUX_MOUNT_H */

View File

@ -7,10 +7,11 @@
#include <linux/netfilter.h>
#include <linux/typelimits.h>
/* only for userspace compatibility */
#include <limits.h> /* for INT_MIN, INT_MAX */
/* IP Hooks */
/* After promisc drops, checksum checks. */
#define NF_IP_PRE_ROUTING 0
@ -25,7 +26,7 @@
#define NF_IP_NUMHOOKS 5
enum nf_ip_hook_priorities {
NF_IP_PRI_FIRST = __KERNEL_INT_MIN,
NF_IP_PRI_FIRST = INT_MIN,
NF_IP_PRI_RAW_BEFORE_DEFRAG = -450,
NF_IP_PRI_CONNTRACK_DEFRAG = -400,
NF_IP_PRI_RAW = -300,
@ -38,8 +39,8 @@ enum nf_ip_hook_priorities {
NF_IP_PRI_NAT_SRC = 100,
NF_IP_PRI_SELINUX_LAST = 225,
NF_IP_PRI_CONNTRACK_HELPER = 300,
NF_IP_PRI_CONNTRACK_CONFIRM = __KERNEL_INT_MAX,
NF_IP_PRI_LAST = __KERNEL_INT_MAX,
NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
NF_IP_PRI_LAST = INT_MAX,
};
/* Arguments for setsockopt SOL_IP: */

View File

@ -11,7 +11,7 @@
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
* Copyright 2008 Colin McCabe <colin@cozybit.com>
* Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2026 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -2974,16 +2974,6 @@ enum nl80211_commands {
* primary channel is 2 MHz wide, and the control channel designates
* the 1 MHz primary subchannel within that 2 MHz primary.
*
* @NL80211_ATTR_EPP_PEER: A flag attribute to indicate if the peer is an EPP
* STA. Used with %NL80211_CMD_NEW_STA and %NL80211_CMD_ADD_LINK_STA
*
* @NL80211_ATTR_UHR_CAPABILITY: UHR Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION). Can be set
* only if HE/EHT are also available.
* @NL80211_ATTR_DISABLE_UHR: Force UHR capable interfaces to disable
* this feature during association. This is a flag attribute.
* Currently only supported in mac80211 drivers.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@ -3552,11 +3542,6 @@ enum nl80211_attrs {
NL80211_ATTR_S1G_PRIMARY_2MHZ,
NL80211_ATTR_EPP_PEER,
NL80211_ATTR_UHR_CAPABILITY,
NL80211_ATTR_DISABLE_UHR,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@ -3909,12 +3894,6 @@ enum nl80211_eht_ru_alloc {
* @NL80211_RATE_INFO_4_MHZ_WIDTH: 4 MHz S1G rate
* @NL80211_RATE_INFO_8_MHZ_WIDTH: 8 MHz S1G rate
* @NL80211_RATE_INFO_16_MHZ_WIDTH: 16 MHz S1G rate
* @NL80211_RATE_INFO_UHR_MCS: UHR MCS index (u8, 0-15, 17, 19, 20, 23)
* Note that the other EHT attributes (such as @NL80211_RATE_INFO_EHT_NSS)
* are used in conjunction with this where applicable
* @NL80211_RATE_INFO_UHR_ELR: UHR ELR flag, which restricts NSS to 1,
* MCS to 0 or 1, and GI to %NL80211_RATE_INFO_EHT_GI_1_6.
* @NL80211_RATE_INFO_UHR_IM: UHR Interference Mitigation flag
* @__NL80211_RATE_INFO_AFTER_LAST: internal use
*/
enum nl80211_rate_info {
@ -3948,9 +3927,6 @@ enum nl80211_rate_info {
NL80211_RATE_INFO_4_MHZ_WIDTH,
NL80211_RATE_INFO_8_MHZ_WIDTH,
NL80211_RATE_INFO_16_MHZ_WIDTH,
NL80211_RATE_INFO_UHR_MCS,
NL80211_RATE_INFO_UHR_ELR,
NL80211_RATE_INFO_UHR_IM,
/* keep last */
__NL80211_RATE_INFO_AFTER_LAST,
@ -4273,10 +4249,6 @@ enum nl80211_mpath_info {
* capabilities element
* @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE: EHT PPE thresholds information as
* defined in EHT capabilities element
* @NL80211_BAND_IFTYPE_ATTR_UHR_CAP_MAC: UHR MAC capabilities as in UHR
* capabilities element
* @NL80211_BAND_IFTYPE_ATTR_UHR_CAP_PHY: UHR PHY capabilities as in UHR
* capabilities element
* @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
* @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
*/
@ -4294,8 +4266,6 @@ enum nl80211_band_iftype_attr {
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE,
NL80211_BAND_IFTYPE_ATTR_UHR_CAP_MAC,
NL80211_BAND_IFTYPE_ATTR_UHR_CAP_PHY,
/* keep last */
__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
@ -4475,11 +4445,6 @@ enum nl80211_wmm_rule {
* channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_16MHZ: 16 MHz operation is not allowed on this
* channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY: Channel is not permitted for use
* as a primary channel. Does not prevent the channel from existing
* as a non-primary subchannel. Only applicable to S1G channels.
* @NL80211_FREQUENCY_ATTR_NO_UHR: UHR operation is not allowed on this channel
* in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@ -4528,8 +4493,6 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_NO_4MHZ,
NL80211_FREQUENCY_ATTR_NO_8MHZ,
NL80211_FREQUENCY_ATTR_NO_16MHZ,
NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY,
NL80211_FREQUENCY_ATTR_NO_UHR,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
@ -4743,7 +4706,6 @@ enum nl80211_sched_scan_match_attr {
* despite NO_IR configuration.
* @NL80211_RRF_ALLOW_20MHZ_ACTIVITY: Allow activity in 20 MHz bandwidth,
* despite NO_IR configuration.
* @NL80211_RRF_NO_UHR: UHR operation not allowed
*/
enum nl80211_reg_rule_flags {
NL80211_RRF_NO_OFDM = 1 << 0,
@ -4770,7 +4732,6 @@ enum nl80211_reg_rule_flags {
NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1 << 23,
NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1 << 24,
NL80211_RRF_ALLOW_20MHZ_ACTIVITY = 1 << 25,
NL80211_RRF_NO_UHR = 1 << 26,
};
#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
@ -5465,7 +5426,6 @@ enum nl80211_bss_status {
* @NL80211_AUTHTYPE_FILS_SK: Fast Initial Link Setup shared key
* @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS
* @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key
* @NL80211_AUTHTYPE_EPPKE: Enhanced Privacy Protection Key Exchange
* @__NL80211_AUTHTYPE_NUM: internal
* @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
* @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
@ -5481,7 +5441,6 @@ enum nl80211_auth_type {
NL80211_AUTHTYPE_FILS_SK,
NL80211_AUTHTYPE_FILS_SK_PFS,
NL80211_AUTHTYPE_FILS_PK,
NL80211_AUTHTYPE_EPPKE,
/* keep last */
__NL80211_AUTHTYPE_NUM,
@ -6786,15 +6745,6 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_BEACON_RATE_EHT: Driver supports beacon rate
* configuration (AP/mesh) with EHT rates.
*
* @NL80211_EXT_FEATURE_EPPKE: Driver supports Enhanced Privacy Protection
* Key Exchange (EPPKE) with user space SME (NL80211_CMD_AUTHENTICATE)
* in non-AP STA mode.
*
* @NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION: This specifies that the
* driver supports encryption of (Re)Association Request and Response
* frames in both nonAP STA and AP mode as specified in
* "IEEE P802.11bi/D3.0, 12.16.6".
*
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
@ -6871,8 +6821,6 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_DFS_CONCURRENT,
NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT,
NL80211_EXT_FEATURE_BEACON_RATE_EHT,
NL80211_EXT_FEATURE_EPPKE,
NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
@ -7485,8 +7433,6 @@ enum nl80211_nan_band_conf_attributes {
* address that can take values from 50-6F-9A-01-00-00 to
* 50-6F-9A-01-FF-FF. This attribute is optional. If not present,
* a random Cluster ID will be chosen.
* This attribute will be ignored in NL80211_CMD_CHANGE_NAN_CONFIG
* since after NAN was started, the cluster ID can no longer change.
* @NL80211_NAN_CONF_EXTRA_ATTRS: Additional NAN attributes to be
* published in the beacons. This is an optional byte array.
* @NL80211_NAN_CONF_VENDOR_ELEMS: Vendor-specific elements that will
@ -7821,30 +7767,6 @@ enum nl80211_peer_measurement_attrs {
* trigger based ranging measurement is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
* if non-trigger-based ranging measurement is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_6GHZ_SUPPORT: flag attribute indicating if
* ranging on the 6 GHz band is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_TX_LTF_REP: u32 attribute indicating
* the maximum number of LTF repetitions the device can transmit in the
* preamble of the ranging NDP (zero means only one LTF, no repetitions)
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_RX_LTF_REP: u32 attribute indicating
* the maximum number of LTF repetitions the device can receive in the
* preamble of the ranging NDP (zero means only one LTF, no repetitions)
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_TX_STS: u32 attribute indicating
* the maximum number of space-time streams supported for ranging NDP TX
* (zero-based)
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_RX_STS: u32 attribute indicating
* the maximum number of space-time streams supported for ranging NDP RX
* (zero-based)
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_TX: u32 attribute indicating the
* maximum total number of LTFs the device can transmit. The total number
* of LTFs is (number of LTF repetitions) * (number of space-time streams).
* This limits the allowed combinations of LTF repetitions and STS.
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_RX: u32 attribute indicating the
* maximum total number of LTFs the device can receive. The total number
* of LTFs is (number of LTF repetitions) * (number of space-time streams).
* This limits the allowed combinations of LTF repetitions and STS.
* @NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT: flag attribute indicating the
* device supports operating as the RSTA in PMSR FTM request
*
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
@ -7862,14 +7784,6 @@ enum nl80211_peer_measurement_ftm_capa {
NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED,
NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED,
NL80211_PMSR_FTM_CAPA_ATTR_6GHZ_SUPPORT,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TX_LTF_REP,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_RX_LTF_REP,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TX_STS,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_RX_STS,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_TX,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_RX,
NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT,
/* keep last */
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
@ -7885,15 +7799,12 @@ enum nl80211_peer_measurement_ftm_capa {
* &enum nl80211_preamble), optional for DMG (u32)
* @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in
* 802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element"
* (u8, 0-15, optional with default 15 i.e. "no preference". No limit for
* non-EDCA ranging)
* (u8, 0-15, optional with default 15 i.e. "no preference")
* @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units
* of 100ms (u16, optional with default 0)
* @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016
* Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with
* default 15 i.e. "no preference"). For non-EDCA ranging, this is the
* burst duration in milliseconds (optional with default 0, i.e. let the
* device decide).
* default 15 i.e. "no preference")
* @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames
* requested per burst
* (u8, 0-31, optional with default 0 i.e. "no preference")
@ -7922,14 +7833,6 @@ enum nl80211_peer_measurement_ftm_capa {
* @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the
* responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED
* or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set.
* @NL80211_PMSR_FTM_REQ_ATTR_RSTA: optional. Request to perform the measurement
* as the RSTA (flag). When set, the device is expected to dwell on the
* channel specified in %NL80211_PMSR_PEER_ATTR_CHAN until it receives the
* FTM request from the peer or the timeout specified by
* %NL80211_ATTR_TIMEOUT has expired.
* Only valid if %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK is set (so the
* RSTA will have the measurement results to report back in the FTM
* response).
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@ -7950,7 +7853,6 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
NL80211_PMSR_FTM_REQ_ATTR_RSTA,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
@ -8035,8 +7937,6 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
* 9.4.2.22.1) starting with the Measurement Token, with Measurement
* Type 11.
* @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only
* @NL80211_PMSR_FTM_RESP_ATTR_BURST_PERIOD: actual burst period used by
* the responder (similar to request, u16)
*
* @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal
* @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number
@ -8065,7 +7965,6 @@ enum nl80211_peer_measurement_ftm_resp {
NL80211_PMSR_FTM_RESP_ATTR_LCI,
NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
NL80211_PMSR_FTM_RESP_ATTR_PAD,
NL80211_PMSR_FTM_RESP_ATTR_BURST_PERIOD,
/* keep last */
NUM_NL80211_PMSR_FTM_RESP_ATTR,

View File

@ -1036,7 +1036,6 @@ enum {
TCA_CAKE_STATS_DROP_NEXT_US,
TCA_CAKE_STATS_P_DROP,
TCA_CAKE_STATS_BLUE_TIMER_US,
TCA_CAKE_STATS_ACTIVE_QUEUES,
__TCA_CAKE_STATS_MAX
};
#define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1)

View File

@ -386,41 +386,4 @@ struct prctl_mm_map {
# define PR_FUTEX_HASH_SET_SLOTS 1
# define PR_FUTEX_HASH_GET_SLOTS 2
/* RSEQ time slice extensions */
#define PR_RSEQ_SLICE_EXTENSION 79
# define PR_RSEQ_SLICE_EXTENSION_GET 1
# define PR_RSEQ_SLICE_EXTENSION_SET 2
/*
* Bits for RSEQ_SLICE_EXTENSION_GET/SET
* PR_RSEQ_SLICE_EXT_ENABLE: Enable
*/
# define PR_RSEQ_SLICE_EXT_ENABLE 0x01
/*
* Get the current indirect branch tracking configuration for the current
* thread, this will be the value configured via PR_SET_INDIR_BR_LP_STATUS.
*/
#define PR_GET_INDIR_BR_LP_STATUS 80
/*
* Set the indirect branch tracking configuration. PR_INDIR_BR_LP_ENABLE will
* enable cpu feature for user thread, to track all indirect branches and ensure
* they land on arch defined landing pad instruction.
* x86 - If enabled, an indirect branch must land on an ENDBRANCH instruction.
* arch64 - If enabled, an indirect branch must land on a BTI instruction.
* riscv - If enabled, an indirect branch must land on an lpad instruction.
* PR_INDIR_BR_LP_DISABLE will disable feature for user thread and indirect
* branches will no more be tracked by cpu to land on arch defined landing pad
* instruction.
*/
#define PR_SET_INDIR_BR_LP_STATUS 81
# define PR_INDIR_BR_LP_ENABLE (1UL << 0)
/*
* Prevent further changes to the specified indirect branch tracking
* configuration. All bits may be locked via this call, including
* undefined bits.
*/
#define PR_LOCK_INDIR_BR_LP_STATUS 82
#endif /* _LINUX_PRCTL_H */

View File

@ -69,10 +69,6 @@
#define __counted_by_be(m)
#endif
#ifndef __counted_by_ptr
#define __counted_by_ptr(m)
#endif
#define __kernel_nonstring
#endif /* _LINUX_STDDEF_H */

View File

@ -1,8 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_TYPELIMITS_H
#define _LINUX_TYPELIMITS_H
#define __KERNEL_INT_MAX ((int)(~0U >> 1))
#define __KERNEL_INT_MIN (-__KERNEL_INT_MAX - 1)
#endif /* _LINUX_TYPELIMITS_H */

View File

@ -2927,6 +2927,7 @@ static int method_can_shutdown_or_sleep(
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
bool multiple_sessions, challenge, blocked, check_unit_state = true;
const HandleActionData *a;
const char *result = NULL;
uid_t uid;
int r;
@ -2983,27 +2984,12 @@ static int method_can_shutdown_or_sleep(
if (r < 0)
return r;
if (!streq(load_state, "loaded"))
return sd_bus_reply_method_return(message, "s", "no");
if (!streq(load_state, "loaded")) {
result = "no";
goto finish;
}
}
const char *result;
r = bus_test_polkit(
message,
a->polkit_action,
/* details= */ NULL,
/* good_user= */ UID_INVALID,
&challenge,
error);
if (r < 0)
return r;
if (r > 0)
result = "yes";
else if (challenge)
result = "challenge";
else
result = "no";
if (multiple_sessions) {
r = bus_test_polkit(
message,
@ -3015,13 +3001,12 @@ static int method_can_shutdown_or_sleep(
if (r < 0)
return r;
if (r == 0) {
if (challenge) {
if (streq(result, "yes")) /* Avoid upgrading no -> challenge */
result = "challenge";
} else
result = "no";
}
if (r > 0)
result = "yes";
else if (challenge)
result = "challenge";
else
result = "no";
}
if (blocked) {
@ -3035,21 +3020,39 @@ static int method_can_shutdown_or_sleep(
if (r < 0)
return r;
if (r == 0) {
if (challenge) {
if (streq(result, "yes"))
result = "inhibited";
/* If result is already "challenge" or "no", the held inhibitor has no effect */
} else {
if (streq(result, "yes"))
result = "inhibitor-blocked";
else if (streq(result, "challenge"))
result = "challenge-inhibitor-blocked";
/* If the result is already "no", the held inhibitor has no effect */
}
}
if (r > 0) {
if (!result)
result = "yes";
} else if (challenge) {
if (!result || streq(result, "yes"))
result = "challenge";
} else
result = "no";
}
if (!multiple_sessions && !blocked) {
/* If neither inhibit nor multiple sessions
* apply then just check the normal policy */
r = bus_test_polkit(
message,
a->polkit_action,
/* details= */ NULL,
/* good_user= */ UID_INVALID,
&challenge,
error);
if (r < 0)
return r;
if (r > 0)
result = "yes";
else if (challenge)
result = "challenge";
else
result = "no";
}
finish:
return sd_bus_reply_method_return(message, "s", result);
}
@ -3960,7 +3963,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_PROPERTY("RuntimeDirectorySize", "t", NULL, offsetof(Manager, runtime_dir_size), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RuntimeDirectoryInodesMax", "t", NULL, offsetof(Manager, runtime_dir_inodes), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("InhibitorsMax", "t", NULL, offsetof(Manager, inhibitors_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("NCurrentInhibitors", "t", property_get_hashmap_size, offsetof(Manager, inhibitors), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("NCurrentInhibitors", "t", property_get_hashmap_size, offsetof(Manager, inhibitors), 0),
SD_BUS_PROPERTY("SessionsMax", "t", NULL, offsetof(Manager, sessions_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("NCurrentSessions", "t", property_get_hashmap_size, offsetof(Manager, sessions), 0),
SD_BUS_PROPERTY("UserTasksMax", "t", property_get_compat_user_tasks_max, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),

View File

@ -148,11 +148,13 @@ static int inhibitor_save(Inhibitor *i) {
}
static int bus_manager_send_inhibited_change(Inhibitor *i) {
const char *property;
assert(i);
return manager_send_changed(i->manager,
i->mode == INHIBIT_DELAY ? "DelayInhibited" : "BlockInhibited",
"NCurrentInhibitors");
property = IN_SET(i->mode, INHIBIT_BLOCK, INHIBIT_BLOCK_WEAK) ? "BlockInhibited" : "DelayInhibited";
return manager_send_changed(i->manager, property);
}
int inhibitor_start(Inhibitor *i) {

View File

@ -155,7 +155,7 @@ static int mdns_maintenance_query(sd_event_source *s, uint64_t usec, void *userd
return 0;
}
int dns_add_new_service(DnsServiceBrowser *sb, DnsResourceRecord *rr, int owner_family, int ifindex, usec_t until) {
int dns_add_new_service(DnsServiceBrowser *sb, DnsResourceRecord *rr, int owner_family, usec_t until) {
_cleanup_(dnssd_discovered_service_unrefp) DnssdDiscoveredService *s = NULL;
int r;
@ -173,7 +173,6 @@ int dns_add_new_service(DnsServiceBrowser *sb, DnsResourceRecord *rr, int owner_
.service_browser = sb,
.rr = dns_resource_record_copy(rr),
.family = owner_family,
.ifindex = ifindex,
.until = until,
.query = NULL,
.rr_ttl_state = DNS_RECORD_TTL_STATE_80_PERCENT,
@ -327,7 +326,6 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
DNS_ANSWER_FOREACH_ITEM(item, answer) {
_cleanup_free_ char *name = NULL, *type = NULL, *domain = NULL;
_cleanup_(sd_json_variant_unrefp) sd_json_variant *entry = NULL;
int ifindex;
if (dns_service_match_and_update(sb->dns_services, item->rr, owner_family, item->until))
continue;
@ -351,10 +349,7 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
if (!type)
continue;
/* Prefer the per-item ifindex, fall back to the service browser's ifindex */
ifindex = item->ifindex > 0 ? item->ifindex : sb->ifindex;
r = dns_add_new_service(sb, item->rr, owner_family, ifindex, item->until);
r = dns_add_new_service(sb, item->rr, owner_family, item->until);
if (r < 0) {
log_error_errno(r, "Failed to add new DNS service: %m");
goto finish;
@ -365,7 +360,7 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
strna(type),
strna(domain),
strna(af_to_ipv4_ipv6(owner_family)),
ifindex);
sb->ifindex);
r = sd_json_buildo(
&entry,
@ -380,7 +375,7 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
!isempty(type), "type", SD_JSON_BUILD_STRING(type)),
SD_JSON_BUILD_PAIR_CONDITION(
!isempty(domain), "domain", SD_JSON_BUILD_STRING(domain)),
SD_JSON_BUILD_PAIR_INTEGER("ifindex", ifindex));
SD_JSON_BUILD_PAIR_INTEGER("ifindex", sb->ifindex));
if (r < 0) {
log_error_errno(r, "Failed to build JSON for new service: %m");
goto finish;
@ -397,7 +392,6 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
LIST_FOREACH(dns_services, service, sb->dns_services) {
_cleanup_free_ char *name = NULL, *type = NULL, *domain = NULL;
_cleanup_(sd_json_variant_unrefp) sd_json_variant *entry = NULL;
int ifindex;
if (service->family != owner_family)
continue;
@ -422,9 +416,6 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
}
}
/* Capture ifindex before removing the service */
ifindex = service->ifindex;
dns_remove_service(sb, service);
log_debug("Remove from the list %s, %s, %s, %s, %d",
@ -432,7 +423,7 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
strna(type),
strna(domain),
strna(af_to_ipv4_ipv6(owner_family)),
ifindex);
sb->ifindex);
r = sd_json_buildo(
&entry,
@ -444,7 +435,7 @@ int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int ow
SD_JSON_BUILD_PAIR_STRING("name", name ?: ""),
SD_JSON_BUILD_PAIR_STRING("type", type ?: ""),
SD_JSON_BUILD_PAIR_STRING("domain", domain ?: ""),
SD_JSON_BUILD_PAIR_INTEGER("ifindex", ifindex));
SD_JSON_BUILD_PAIR_INTEGER("ifindex", sb->ifindex));
if (r < 0) {
log_error_errno(r, "Failed to build JSON for removed service: %m");
goto finish;
@ -482,61 +473,19 @@ finish:
int mdns_browser_revisit_cache(DnsServiceBrowser *sb, int owner_family) {
_cleanup_(dns_answer_unrefp) DnsAnswer *lookup_ret_answer = NULL;
DnsScope *scope;
int r;
assert(sb);
assert(sb->manager);
/* ifindex=0 means "all interfaces" */
if (sb->ifindex == 0) {
LIST_FOREACH(scopes, scope, sb->manager->dns_scopes) {
_cleanup_(dns_answer_unrefp) DnsAnswer *answer = NULL;
if (scope->protocol != DNS_PROTOCOL_MDNS)
continue;
if (scope->family != owner_family)
continue;
dns_cache_prune(&scope->cache);
r = dns_cache_lookup(
&scope->cache,
sb->key,
sb->flags,
/* ret_rcode= */ NULL,
&answer,
/* ret_full_packet= */ NULL,
/* ret_query_flags= */ NULL,
/* ret_dnssec_result= */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to look up DNS cache for service browser key on scope %s: %m",
dns_scope_ifname(scope) ?: "global");
r = mdns_manage_services_answer(sb, answer, owner_family);
if (r < 0)
return log_error_errno(r, "Failed to manage mDNS services after cache lookup on scope %s: %m",
dns_scope_ifname(scope) ?: "global");
}
return 0;
}
/* Single scope for specifically requested interface */
DnsScope *scope = manager_find_scope_from_protocol(sb->manager, sb->ifindex, DNS_PROTOCOL_MDNS, owner_family);
scope = manager_find_scope_from_protocol(sb->manager, sb->ifindex, DNS_PROTOCOL_MDNS, owner_family);
if (!scope)
return 0;
dns_cache_prune(&scope->cache);
r = dns_cache_lookup(
&scope->cache,
sb->key,
sb->flags,
/* ret_rcode= */ NULL,
&lookup_ret_answer,
/* ret_full_packet= */ NULL,
/* ret_query_flags= */ NULL,
/* ret_dnssec_result= */ NULL);
r = dns_cache_lookup(&scope->cache, sb->key, sb->flags, NULL, &lookup_ret_answer, NULL, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to look up DNS cache for service browser key: %m");
@ -718,9 +667,6 @@ int dns_subscribe_browse_service(
if (ifindex < 0)
return sd_varlink_error_invalid_parameter_name(link, "ifindex");
if (ifindex == 0)
log_debug("BrowseServices: browsing all mDNS interfaces");
if (isempty(type))
type = NULL;
else if (!dnssd_srv_type_is_valid(type))

View File

@ -30,7 +30,6 @@ struct DnssdDiscoveredService {
sd_event_source *schedule_event;
DnsResourceRecord *rr;
int family;
int ifindex;
usec_t until;
DnsRecordTTLState rr_ttl_state;
DnsQuery *query;
@ -67,7 +66,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DnssdDiscoveredService *, dnssd_discovered_service_u
bool dns_service_match_and_update(DnssdDiscoveredService *services, DnsResourceRecord *rr, int owner_family, usec_t until);
int mdns_manage_services_answer(DnsServiceBrowser *sb, DnsAnswer *answer, int owner_family);
int dns_add_new_service(DnsServiceBrowser *sb, DnsResourceRecord *rr, int owner_family, int ifindex, usec_t until);
int dns_add_new_service(DnsServiceBrowser *sb, DnsResourceRecord *rr, int owner_family, usec_t until);
int mdns_service_update(DnssdDiscoveredService *service, DnsResourceRecord *rr, usec_t t, usec_t until);
int mdns_browser_revisit_cache(DnsServiceBrowser *sb, int owner_family);
int dns_subscribe_browse_service(

View File

@ -24,7 +24,6 @@
#include "varlink-io.systemd.Hostname.h"
#include "varlink-io.systemd.Import.h"
#include "varlink-io.systemd.Journal.h"
#include "varlink-io.systemd.JournalAccess.h"
#include "varlink-io.systemd.Login.h"
#include "varlink-io.systemd.Machine.h"
#include "varlink-io.systemd.MachineImage.h"
@ -189,7 +188,6 @@ TEST(parse_format) {
&vl_interface_io_systemd_Hostname,
&vl_interface_io_systemd_Import,
&vl_interface_io_systemd_Journal,
&vl_interface_io_systemd_JournalAccess,
&vl_interface_io_systemd_Login,
&vl_interface_io_systemd_Machine,
&vl_interface_io_systemd_MachineImage,

View File

@ -193,50 +193,6 @@ testcase_single_service_multiple_times() {
done
}
# Helper function to run browse services with a custom ifindex
run_and_check_services_with_ifindex() {
local service_id="${1:?}"
local check_func="${2:?}"
local ifindex="${3:?}"
local unit_name="varlinkctl-$service_id-$SRANDOM.service"
local i out_file parameters service_type svc tmp_file
out_file="$(mktemp)"
error_file="$(mktemp)"
tmp_file="$(mktemp)"
service_type="_testService$service_id._udp"
parameters="{ \"domain\": \"$service_type.local\", \"type\": \"\", \"ifindex\": $ifindex, \"flags\": 16785432 }"
systemd-run --unit="$unit_name" --service-type=exec -p StandardOutput="file:$out_file" -p StandardError="file:$error_file" \
varlinkctl call --more /run/systemd/resolve/io.systemd.Resolve io.systemd.Resolve.BrowseServices "$parameters"
# shellcheck disable=SC2064
# Note: same as above about unregistering the trap once it's fired
trap "trap - RETURN; systemctl stop $unit_name" RETURN
for _ in {0..14}; do
if [[ -s "$out_file" ]]; then
grep -o '"name":"[^"]*"' "$out_file" | sed 's/"name":"//;s/"//g' | sort | tee "$tmp_file"
if "$check_func" "$service_id" "$tmp_file"; then
return 0
fi
fi
sleep 2
done
cat "$out_file"
cat "$error_file"
return 1
}
testcase_browse_all_interfaces_ifindex_zero() {
: "Test browsing all interfaces with ifindex=0"
resolvectl flush-caches
# Using ifindex=0 should discover services on all mDNS interfaces
run_and_check_services_with_ifindex 0 check_both 0
}
testcase_second_unreachable() {
: "Test each service type while the second container is unreachable"
systemd-run -M "$CONTAINER_2" --wait --pipe -- networkctl down host0

View File

@ -12,7 +12,6 @@ Description=Journal Log Access Socket
Documentation=man:journalctl(1)
DefaultDependencies=no
Before=sockets.target
After=systemd-sysusers.service
[Socket]
ListenStream=/run/systemd/io.systemd.JournalAccess