]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: hook up "machine tag" concept, also with .network/.link/.netdev files
authorLennart Poettering <lennart@amutable.com>
Mon, 1 Jun 2026 08:23:50 +0000 (10:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jun 2026 18:38:13 +0000 (20:38 +0200)
Follow-up for: 461ec6facc4291cbdb3264d473bcab3e1d88e13a

man/systemd.link.xml
man/systemd.netdev.xml
man/systemd.network.xml
src/network/netdev/netdev-gperf.gperf
src/network/networkd-network-gperf.gperf
src/udev/net/link-config-gperf.gperf

index 1d6fbf9fb876dfd4664ccfb706126e4923188073..5f5930adf50e62f06802fb7b7017a064a0ab937f 100644 (file)
           <xi:include href="version-info.xml" xpointer="v249"/>
         </listitem>
       </varlistentry>
+
+      <varlistentry id='machine-tag'>
+        <term><varname>MachineTag=</varname></term>
+        <listitem>
+          <para>Matches against the tags assigned to the local machine. See
+          <varname>ConditionMachineTag=</varname> in
+          <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+          for details. When prefixed with an exclamation mark (<literal>!</literal>), the result is negated.
+          If an empty string is assigned, the previously assigned value is cleared.
+          </para>
+
+          <xi:include href="version-info.xml" xpointer="v262"/>
+        </listitem>
+      </varlistentry>
     </variablelist>
 
   </refsect1>
index 6879518b4b8a3bb5c9e1469f6575d70130a6cd6d..66d5334b37b3542f919631a24b7be96a2af838cd 100644 (file)
       <xi:include href="systemd.link.xml" xpointer="credential" />
       <xi:include href="systemd.link.xml" xpointer="architecture" />
       <xi:include href="systemd.link.xml" xpointer="firmware" />
+      <xi:include href="systemd.link.xml" xpointer="machine-tag" />
     </variablelist>
   </refsect1>
 
index 971dce73fc1386d6bfc2dac74a8a81f3978e0eda..6b988e0e4744a9742da98a0addb92e4e72f560b4 100644 (file)
       <xi:include href="systemd.link.xml" xpointer="credential" />
       <xi:include href="systemd.link.xml" xpointer="architecture" />
       <xi:include href="systemd.link.xml" xpointer="firmware" />
+      <xi:include href="systemd.link.xml" xpointer="machine-tag" />
     </variablelist>
   </refsect1>
 
index 269a97454240846d24a111ce7406342e198aae7a..70af349108d9256207b0527c8e65ce4666a30461 100644 (file)
@@ -52,6 +52,7 @@ Match.Version,                            config_parse_net_condition,
 Match.Credential,                         config_parse_net_condition,                     CONDITION_CREDENTIAL,          offsetof(NetDev, conditions)
 Match.Architecture,                       config_parse_net_condition,                     CONDITION_ARCHITECTURE,        offsetof(NetDev, conditions)
 Match.Firmware,                           config_parse_net_condition,                     CONDITION_FIRMWARE,            offsetof(NetDev, conditions)
+Match.MachineTag,                         config_parse_net_condition,                     CONDITION_MACHINE_TAG,         offsetof(NetDev, conditions)
 NetDev.Description,                       config_parse_string,                            0,                             offsetof(NetDev, description)
 NetDev.Name,                              config_parse_ifname,                            0,                             offsetof(NetDev, ifname)
 NetDev.Kind,                              config_parse_netdev_kind,                       0,                             offsetof(NetDev, kind)
index 81b9784b49a4cb16970d9844181f77e1a7717e2b..0b598f131d9a567642ef0196e15af4f5bb7680d8 100644 (file)
@@ -94,6 +94,7 @@ Match.Version,                                   config_parse_net_condition,
 Match.Credential,                                config_parse_net_condition,                     CONDITION_CREDENTIAL,                   offsetof(Network, conditions)
 Match.Architecture,                              config_parse_net_condition,                     CONDITION_ARCHITECTURE,                 offsetof(Network, conditions)
 Match.Firmware,                                  config_parse_net_condition,                     CONDITION_FIRMWARE,                     offsetof(Network, conditions)
+Match.MachineTag,                                config_parse_net_condition,                     CONDITION_MACHINE_TAG,                  offsetof(Network, conditions)
 Link.MACAddress,                                 config_parse_hw_addr,                           0,                                      offsetof(Network, hw_addr)
 Link.MTUBytes,                                   config_parse_mtu,                               AF_UNSPEC,                              offsetof(Network, mtu)
 Link.Group,                                      config_parse_link_group,                        0,                                      0
index a005cadd49a61b44a03a0ea1d6568be7b1a9a324..535c9e9dbb76bd8d405bfacfe72b5d336571c44a 100644 (file)
@@ -40,6 +40,7 @@ Match.Version,                             config_parse_net_condition,
 Match.Credential,                          config_parse_net_condition,            CONDITION_CREDENTIAL,          offsetof(LinkConfig, conditions)
 Match.Architecture,                        config_parse_net_condition,            CONDITION_ARCHITECTURE,        offsetof(LinkConfig, conditions)
 Match.Firmware,                            config_parse_net_condition,            CONDITION_FIRMWARE,            offsetof(LinkConfig, conditions)
+Match.MachineTag,                          config_parse_net_condition,            CONDITION_MACHINE_TAG,         offsetof(LinkConfig, conditions)
 Link.Description,                          config_parse_string,                   0,                             offsetof(LinkConfig, description)
 /* udev property */
 Link.Property,                             config_parse_udev_property,            0,                             offsetof(LinkConfig, properties)