1
0
mirror of https://github.com/systemd/systemd synced 2025-09-26 15:24:44 +02:00

Compare commits

...

34 Commits

Author SHA1 Message Date
Yu Watanabe
dca63b5b46
Merge pull request #17474 from yuwata/network-drop-link-deserialization-logic
network: drop link deserialization logic
2020-11-27 09:08:01 +09:00
Yu Watanabe
0d5eb02134
Merge pull request #17478 from yuwata/split-network-internal
libsystemd-network: split network-internal.c
2020-11-27 09:04:19 +09:00
Pavel Sapezhko
6d8325f66a resolved: allow cache responses from local DNS servers 2020-11-27 09:03:42 +09:00
Christian Hesse
2bb703e440 oom: fix oomd.conf install location
The file is read in pkgsysconfdir, so install it there.
2020-11-27 09:03:18 +09:00
Christian Hesse
72a4466e6e home: fix homed.conf install location
The install location changed in d7aa78c32f076c305ceeb183fc06eb1de0960deb,
I think this was not intentional. Keep the condition but revert the path.
2020-11-27 09:02:55 +09:00
Zbigniew Jędrzejewski-Szmek
4d484e14bb
Merge pull request #17738 from keszybz/hwdb-news-update-v247
Update hwdb and news for v247
2020-11-26 19:00:50 +01:00
Zbigniew Jędrzejewski-Szmek
d90922fbd3 NEWS: fix kernel version number reference
Fixes #17736.
2020-11-26 14:01:09 +01:00
Zbigniew Jędrzejewski-Szmek
d0dcf59b78 NEWS: version 247 2020-11-26 13:54:37 +01:00
Zbigniew Jędrzejewski-Szmek
fe7576e345 hwdb: update chromiumos autosuspend rules 2020-11-26 13:54:37 +01:00
Zbigniew Jędrzejewski-Szmek
6a8b36e7aa hwdb: update for v247
Only some small changes, because we updated recently. As usual, it seems that there are mostly
additions with a smaller amount of corrections, no big removals.
2020-11-26 13:54:37 +01:00
Zbigniew Jędrzejewski-Szmek
89341c83c3 docs/RELEASE: clarify which steps are done when 2020-11-26 13:54:37 +01:00
Yu Watanabe
5722fb89bc net-condition: introduce struct NetMatch 2020-10-29 15:04:52 +09:00
Yu Watanabe
26f4d32365 meson: drop libsystemd_network from several binaries
This reduces the size of udevadm:

Before:
```
$ ll udevadm
-rwxrwxr-x 1 watanabe watanabe 1203800 Oct 29 01:36 udevadm
```

After:
```
$ ll udevadm
-rwxrwxr-x 1 watanabe watanabe 1094384 Oct 29 01:38 udevadm
```
2020-10-29 14:23:49 +09:00
Yu Watanabe
01ab92af71 tree-wide: drop unnecessary inclusion of network-internal.h 2020-10-29 14:23:49 +09:00
Yu Watanabe
dc7f6c9b94 sd-network: move net_get_unique_predictable_data() and net_get_name_persisten() 2020-10-29 14:23:49 +09:00
Yu Watanabe
c2f781bc15 conf-parser: fix indentation 2020-10-29 14:23:49 +09:00
Yu Watanabe
7e19cc5462 net-condition: move net_match_config() and related conf parsers 2020-10-29 14:23:49 +09:00
Yu Watanabe
1929ed0e58 sd-network: move link_get_type_string() 2020-10-29 14:23:49 +09:00
Yu Watanabe
0ec2a7a125 libsystemd-network: move config_parse_hwaddr() and config_parse_hwaddrs() 2020-10-29 14:23:49 +09:00
Yu Watanabe
fc27088ae7 udev: move config_parse_ifalias() 2020-10-29 14:23:49 +09:00
Yu Watanabe
796aa313b3 network: move config_parse_bridge_port_priority() 2020-10-29 14:23:49 +09:00
Yu Watanabe
6a74900002 libsystemd-network: make conf parsers accept an empty string 2020-10-29 14:23:49 +09:00
Yu Watanabe
7e7aa4e811 libsystemd-network: downgrade log level in conf parsers 2020-10-29 14:23:49 +09:00
Yu Watanabe
61eb77c4b6 network: drop link_load()
The link state file does not exist, as it is always removed on stop.
2020-10-28 18:16:01 +09:00
Yu Watanabe
6fdcef2174 network: do not serialize/deserialize routes
The same as the previous commit. These are not used.
2020-10-28 18:16:01 +09:00
Yu Watanabe
7b829a7b3b network: do not serialize/deserialize addresses
The link state file is always removed when networkd is stopping. So,
the deserialization logic does not work. Moreover, the ADDRESSES=
entry is not used by sd-network, so serialization is also not necessary.
2020-10-28 18:15:57 +09:00
Yu Watanabe
ca97e7cda0 network: do not serialize/deserialize ipv4ll address
The link state file is always removed on stop. So, we cannot deserialize
the address from the file. Moreover, currently the IPv4 link-local address
is always dropped by link_drop_foreign_addresses() on restart. Let's
drop the serialize/deserialize logic for IPv4 LL address.
2020-10-28 15:46:09 +09:00
Yu Watanabe
778c879533 network: use sysctl_read_ip_property() where applicable 2020-10-28 15:44:10 +09:00
Yu Watanabe
31a9a27d4c sysctl-util: truncate newline in read value 2020-10-28 15:44:10 +09:00
Yu Watanabe
62f12d757c network: downgrade log level in dhcp4_configure() 2020-10-28 15:44:10 +09:00
Yu Watanabe
a41768533f network: always enable sysctl property promote_secondaries
systemd-sysctl already enables promote_secondaries for all interface.
So, networkd also enables it unconditionally.
2020-10-28 15:44:10 +09:00
Yu Watanabe
e69642dccc network: mention that the error will be ignored 2020-10-28 15:44:10 +09:00
Yu Watanabe
5360b089e1 network: drop dhcp4_init()
It is now called by only dhcp4_configure(). Let's merge them.
2020-10-28 15:44:10 +09:00
Yu Watanabe
3def88503a network: set previous DHCP4 address in link->addresses_foreign
Previously, the address was taken from the state file, but DHCP4_ADDRESS=
entry was dropped by 46986251d6eb4c78bb56c080ce310fd2b1f9439f.
Moreover, the link state file is always removed when networkd is
stopping. Let's take the address from the list of enumerated addresses.
2020-10-28 15:44:05 +09:00
67 changed files with 8781 additions and 7104 deletions

62
NEWS
View File

@ -1,8 +1,8 @@
systemd System and Service Manager systemd System and Service Manager
CHANGES WITH 247 in spe: CHANGES WITH 247:
* KERNEL API INCOMPATIBILITY: Linux 4.12 introduced two new uevents * KERNEL API INCOMPATIBILITY: Linux 4.14 introduced two new uevents
"bind" and "unbind" to the Linux device model. When this kernel "bind" and "unbind" to the Linux device model. When this kernel
change was made, systemd-udevd was only minimally updated to handle change was made, systemd-udevd was only minimally updated to handle
and propagate these new event types. The introduction of these new and propagate these new event types. The introduction of these new
@ -655,35 +655,37 @@ CHANGES WITH 247 in spe:
Ross, Amitanand Chikorde, Andrew Hangsleben, Anita Zhang, Ansgar Ross, Amitanand Chikorde, Andrew Hangsleben, Anita Zhang, Ansgar
Burchardt, Arian van Putten, Aurelien Jarno, Axel Rasmussen, bauen1, Burchardt, Arian van Putten, Aurelien Jarno, Axel Rasmussen, bauen1,
Beniamino Galvani, Benjamin Berg, Bjørn Mork, brainrom, Chandradeep Beniamino Galvani, Benjamin Berg, Bjørn Mork, brainrom, Chandradeep
Dey, Charles Lee, Chris Down, Christian Göttsche, Clemens Gruber, Daan Dey, Charles Lee, Chris Down, Christian Göttsche, Christof Efkemann,
De Meyer, Daniele Medri, Daniel Mack, Daniel Rusek, Dan Streetman, Christoph Ruegge, Clemens Gruber, Daan De Meyer, Daniele Medri, Daniel
David Tardon, Dimitri John Ledkov, Dmitry Borodaenko, Elias Probst, Mack, Daniel Rusek, Dan Streetman, David Tardon, Dimitri John Ledkov,
Elisei Roca, ErrantSpore, Etienne Doms, Fabrice Fontaine, fangxiuning, Dmitry Borodaenko, Elias Probst, Elisei Roca, ErrantSpore, Etienne
Felix Riemann, Florian Klink, Franck Bui, Frantisek Sumsal, fwSmit, Doms, Fabrice Fontaine, fangxiuning, Felix Riemann, Florian Klink,
George Rawlinson, germanztz, Gibeom Gwon, Glen Whitney, Gogo Gogsi, Franck Bui, Frantisek Sumsal, fwSmit, George Rawlinson, germanztz,
Göran Uddeborg, Grant Mathews, Hans de Goede, Hans Ulrich Niedermann, Gibeom Gwon, Glen Whitney, Gogo Gogsi, Göran Uddeborg, Grant Mathews,
Haochen Tong, Harald Seiler, huangyong, Hubert Kario, Ikey Doherty, Jan Hans de Goede, Hans Ulrich Niedermann, Haochen Tong, Harald Seiler,
Chren, Jan Schlüter, Jérémy Nouhaud, Jian-Hong Pan, Joerg Behrmann, huangyong, Hubert Kario, igo95862, Ikey Doherty, Insun Pyo, Jan Chren,
Jonathan Lebon, Josh Brobst, Juergen Hoetzel, Julien Humbert, Kai-Chuan Jan Schlüter, Jérémy Nouhaud, Jian-Hong Pan, Joerg Behrmann, Jonathan
Hsieh, Kairui Song, Kamil Dudka, Kir Kolyshkin, Kristijan Gjoshev, Kyle Lebon, Jörg Thalheim, Josh Brobst, Juergen Hoetzel, Julien Humbert,
Huey, Kyle Russell, Lennart Poettering, lichangze, Luca Boccassi, Lucas Kai-Chuan Hsieh, Kairui Song, Kamil Dudka, Kir Kolyshkin, Kristijan
Werkmeister, Luca Weiss, Marc Kleine-Budde, Marco Wang, Martin Wilck, Gjoshev, Kyle Huey, Kyle Russell, Lee Whalen, Lennart Poettering,
Marti Raudsepp, masmullin2000, Máté Pozsgay, Matt Fenwick, Michael lichangze, Luca Boccassi, Lucas Werkmeister, Luca Weiss, Marc
Biebl, Michael Scherer, Michal Koutný, Michal Sekletár, Michal Kleine-Budde, Marco Wang, Martin Wilck, Marti Raudsepp, masmullin2000,
Suchanek, Mikael Szreder, Milo Casagrande, mirabilos, Mitsuha_QuQ, Máté Pozsgay, Matt Fenwick, Michael Biebl, Michael Scherer, Michal
mog422, Muhammet Kara, Nazar Vinnichuk, Nicholas Narsing, Nicolas Koutný, Michal Sekletár, Michal Suchanek, Mikael Szreder, Milo
Fella, Njibhu, nl6720, Oğuz Ersen, Olivier Le Moal, Ondrej Kozina, Casagrande, mirabilos, Mitsuha_QuQ, mog422, Muhammet Kara, Nazar
onlybugreports, Pass Automated Testing Suite, Pat Coulthard, Pedro Vinnichuk, Nicholas Narsing, Nicolas Fella, Njibhu, nl6720, Oğuz Ersen,
Ruiz, Peter Hutterer, Phaedrus Leeds, PhoenixDiscord, Piotr Drąg, Plan Olivier Le Moal, Ondrej Kozina, onlybugreports, Pass Automated Testing
C, Purushottam choudhary, Rasmus Villemoes, Renaud Métrich, Robert Suite, Pat Coulthard, Pavel Sapezhko, Pedro Ruiz, perry_yuan, Peter
Marko, Ronan Pigott, Roy Chen (陳彥廷), RussianNeuroMancer, Samanta Hutterer, Phaedrus Leeds, PhoenixDiscord, Piotr Drąg, Plan C,
Navarro, Samuel BF, scootergrisen, Sorin Ionescu, Steve Dodd, Susant Purushottam choudhary, Rasmus Villemoes, Renaud Métrich, Robert Marko,
Sahani, Timo Rothenpieler, Tobias Hunger, Tobias Kaufmann, Topi Roman Beranek, Ronan Pigott, Roy Chen (陳彥廷), RussianNeuroMancer,
Miettinen, Vito Caputo, Weblate, Wen Yang, williamvds, Yu, Li-Yu, Yuri Samanta Navarro, Samuel BF, scootergrisen, Sorin Ionescu, Steve Dodd,
Chornoivan, Yu Watanabe, Zbigniew Jędrzejewski-Szmek, Zmicer Turok, Susant Sahani, Timo Rothenpieler, Tobias Hunger, Tobias Kaufmann, Topi
Дамјан Георгиевски Miettinen, vanou, Vito Caputo, Weblate, Wen Yang, Whired Planck,
williamvds, Yu, Li-Yu, Yuri Chornoivan, Yu Watanabe, Zbigniew
Jędrzejewski-Szmek, Zmicer Turok, Дамјан Георгиевски
Warsaw, 2020-11-10 Warsaw, 2020-11-26
CHANGES WITH 246: CHANGES WITH 246:

View File

@ -9,14 +9,14 @@ layout: default
1. Add all items to NEWS 1. Add all items to NEWS
2. Update the contributors list in NEWS (`ninja -C build git-contrib`) 2. Update the contributors list in NEWS (`ninja -C build git-contrib`)
3. Update the time and place in NEWS 3. Update the time and place in NEWS
4. Update version and library numbers in `meson.build` 4. [RC1] Update version and library numbers in `meson.build`
5. Check dbus docs with `ninja -C build man/update-dbus-docs` 5. Check dbus docs with `ninja -C build man/update-dbus-docs`
6. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"` 6. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"`
7. Do `ninja -C build` 7. Do `ninja -C build`
8. Make sure that the version string and package string match: `build/systemctl --version` 8. Make sure that the version string and package string match: `build/systemctl --version`
9. Upload the documentation: `ninja -C build doc-sync` 9. Upload the documentation: `ninja -C build doc-sync`
10. [After final release] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones) 10. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones)
11. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate. 11. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate.
12. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically. 12. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically.
13. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`) 13. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`)
14. [After final release] Also push commits to stable, create an empty -stable branch: `git push systemd-stable origin/master:master origin/master:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches). 14. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable origin/master:master origin/master:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches).

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
--- 20-acpi-vendor.hwdb.base 2020-11-10 14:13:39.257693009 +0100 --- 20-acpi-vendor.hwdb.base 2020-11-26 13:49:35.243482590 +0100
+++ 20-acpi-vendor.hwdb 2020-11-10 14:13:39.264693047 +0100 +++ 20-acpi-vendor.hwdb 2020-11-26 13:49:35.260482675 +0100
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
# Data imported from: # Data imported from:
# https://uefi.org/uefi-pnp-export # https://uefi.org/uefi-pnp-export

View File

@ -380,6 +380,12 @@ pci:v*d*sv*sd*bc08sc06*
pci:v*d*sv*sd*bc08sc80* pci:v*d*sv*sd*bc08sc80*
ID_PCI_SUBCLASS_FROM_DATABASE=System peripheral ID_PCI_SUBCLASS_FROM_DATABASE=System peripheral
pci:v*d*sv*sd*bc08sc99*
ID_PCI_SUBCLASS_FROM_DATABASE=Timing Card
pci:v*d*sv*sd*bc08sc99i01*
ID_PCI_INTERFACE_FROM_DATABASE=TAP Timing Card
pci:v*d*sv*sd*bc09* pci:v*d*sv*sd*bc09*
ID_PCI_CLASS_FROM_DATABASE=Input device controller ID_PCI_CLASS_FROM_DATABASE=Input device controller

View File

@ -122,6 +122,9 @@ pci:v0000018Ad00000106*
pci:v000001DE* pci:v000001DE*
ID_VENDOR_FROM_DATABASE=Oxide Computer Company ID_VENDOR_FROM_DATABASE=Oxide Computer Company
pci:v00000200*
ID_VENDOR_FROM_DATABASE=Dell (wrong ID)
pci:v0000021B* pci:v0000021B*
ID_VENDOR_FROM_DATABASE=Compaq Computer Corporation ID_VENDOR_FROM_DATABASE=Compaq Computer Corporation
@ -7979,6 +7982,9 @@ pci:v00001002d00006820sv000017AAsd00003801*
pci:v00001002d00006820sv000017AAsd00003824* pci:v00001002d00006820sv000017AAsd00003824*
ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (Radeon R9 M375) ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (Radeon R9 M375)
pci:v00001002d00006820sv00001DA2sd0000E26A*
ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (Radeon R7 250)
pci:v00001002d00006821* pci:v00001002d00006821*
ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X/M370X] ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X/M370X]
@ -10025,6 +10031,9 @@ pci:v00001002d00006939sv0000148Csd00009380*
pci:v00001002d00006939sv0000174Bsd0000E308* pci:v00001002d00006939sv0000174Bsd0000E308*
ID_MODEL_FROM_DATABASE=Tonga PRO [Radeon R9 285/380] (Radeon R9 380 Nitro 4G D5) ID_MODEL_FROM_DATABASE=Tonga PRO [Radeon R9 285/380] (Radeon R9 380 Nitro 4G D5)
pci:v00001002d00006939sv0000174Bsd0000E315*
ID_MODEL_FROM_DATABASE=Tonga PRO [Radeon R9 285/380] (Radeon R9 285)
pci:v00001002d0000693B* pci:v00001002d0000693B*
ID_MODEL_FROM_DATABASE=Tonga PRO GL [FirePro W7100 / Barco MXRT-7600] ID_MODEL_FROM_DATABASE=Tonga PRO GL [FirePro W7100 / Barco MXRT-7600]
@ -10545,14 +10554,17 @@ pci:v00001002d00007360*
ID_MODEL_FROM_DATABASE=Navi 12 [Radeon Pro 5600M] ID_MODEL_FROM_DATABASE=Navi 12 [Radeon Pro 5600M]
pci:v00001002d000073BF* pci:v00001002d000073BF*
ID_MODEL_FROM_DATABASE=Navi 21 [Radeon RX 6900 Series] ID_MODEL_FROM_DATABASE=Navi 21 [Radeon RX 6800/6800 XT / 6900 XT]
pci:v00001002d000073C3* pci:v00001002d000073C3*
ID_MODEL_FROM_DATABASE=Navi 23 ID_MODEL_FROM_DATABASE=Navi 22
pci:v00001002d000073DF* pci:v00001002d000073DF*
ID_MODEL_FROM_DATABASE=Navi 22 ID_MODEL_FROM_DATABASE=Navi 22
pci:v00001002d000073FF*
ID_MODEL_FROM_DATABASE=Navi 23
pci:v00001002d00007833* pci:v00001002d00007833*
ID_MODEL_FROM_DATABASE=RS350 Host Bridge ID_MODEL_FROM_DATABASE=RS350 Host Bridge
@ -28023,7 +28035,7 @@ pci:v000010DEd000000F4*
ID_MODEL_FROM_DATABASE=NV43 [GeForce 6600 LE] ID_MODEL_FROM_DATABASE=NV43 [GeForce 6600 LE]
pci:v000010DEd000000F5* pci:v000010DEd000000F5*
ID_MODEL_FROM_DATABASE=G71 [GeForce 7800 GS AGP] ID_MODEL_FROM_DATABASE=G70/G71 [GeForce 7800 GS AGP]
pci:v000010DEd000000F6* pci:v000010DEd000000F6*
ID_MODEL_FROM_DATABASE=NV43 [GeForce 6800 GS/XT] ID_MODEL_FROM_DATABASE=NV43 [GeForce 6800 GS/XT]
@ -34682,6 +34694,9 @@ pci:v000010DEd0000128B*
pci:v000010DEd0000128Bsv00001043sd000085F7* pci:v000010DEd0000128Bsv00001043sd000085F7*
ID_MODEL_FROM_DATABASE=GK208B [GeForce GT 710] (GT710-SL-1GD5) ID_MODEL_FROM_DATABASE=GK208B [GeForce GT 710] (GT710-SL-1GD5)
pci:v000010DEd0000128Bsv00001043sd00008770*
ID_MODEL_FROM_DATABASE=GK208B [GeForce GT 710] (GT710-4H-SL-2GD5)
pci:v000010DEd0000128C* pci:v000010DEd0000128C*
ID_MODEL_FROM_DATABASE=GK208B ID_MODEL_FROM_DATABASE=GK208B
@ -35859,13 +35874,13 @@ pci:v000010DEd00002204*
ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3090] ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3090]
pci:v000010DEd00002206* pci:v000010DEd00002206*
ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080 10GB / 20GB] ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080]
pci:v000010DEd00002206sv000010DEsd0000146D* pci:v000010DEd00002206sv000010DEsd0000146D*
ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080 10GB / 20GB] (GA102 [GeForce RTX 3080 20GB]) ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080] (GA102 [GeForce RTX 3080 20GB])
pci:v000010DEd00002206sv00001462sd00003892* pci:v000010DEd00002206sv00001462sd00003892*
ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080 10GB / 20GB] (RTX 3080 10GB GAMING X TRIO) ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3080] (RTX 3080 10GB GAMING X TRIO)
pci:v000010DEd0000222B* pci:v000010DEd0000222B*
ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3090 Engineering Sample] ID_MODEL_FROM_DATABASE=GA102 [GeForce RTX 3090 Engineering Sample]
@ -35883,19 +35898,19 @@ pci:v000010DEd00002482*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 Ti] ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 Ti]
pci:v000010DEd00002484* pci:v000010DEd00002484*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 8GB / 16GB] ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070]
pci:v000010DEd00002484sv000010DEsd0000146B* pci:v000010DEd00002484sv000010DEsd0000146B*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 8GB / 16GB] (GA104 [GeForce RTX 3070]) ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070]
pci:v000010DEd00002484sv000010DEsd000014AE* pci:v000010DEd00002484sv000010DEsd000014AE*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 8GB / 16GB] (GA104 [GeForce RTX 3070 16GB]) ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070] (GA104 [GeForce RTX 3070 16GB])
pci:v000010DEd00002486* pci:v000010DEd00002486*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3060 Ti] ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3060 Ti]
pci:v000010DEd0000249C* pci:v000010DEd0000249C*
ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile / Max-Q] ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile / Max-Q 8GB/16GB]
pci:v000010DEd0000249D* pci:v000010DEd0000249D*
ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile / Max-Q] ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile / Max-Q]
@ -35913,7 +35928,10 @@ pci:v000010DEd000024BF*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 Engineering Sample] ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 Engineering Sample]
pci:v000010DEd000024DC* pci:v000010DEd000024DC*
ID_MODEL_FROM_DATABASE=GA104 [GeForce RTX 3070 16GB Engineering Sample] ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile 16GB]
pci:v000010DEd000024DD*
ID_MODEL_FROM_DATABASE=GA104M [GeForce RTX 3070 Mobile / Max-Q]
pci:v000010DEd0000252F* pci:v000010DEd0000252F*
ID_MODEL_FROM_DATABASE=GA106 [GeForce RTX 3060 Engineering Sample] ID_MODEL_FROM_DATABASE=GA106 [GeForce RTX 3060 Engineering Sample]
@ -36608,6 +36626,9 @@ pci:v000010ECd00005289*
pci:v000010ECd00005289sv00001043sd00001457* pci:v000010ECd00005289sv00001043sd00001457*
ID_MODEL_FROM_DATABASE=RTL8411 PCI Express Card Reader (K55A Laptop) ID_MODEL_FROM_DATABASE=RTL8411 PCI Express Card Reader (K55A Laptop)
pci:v000010ECd00005762*
ID_MODEL_FROM_DATABASE=RTS5763DL NVMe SSD Controller
pci:v000010ECd00008029* pci:v000010ECd00008029*
ID_MODEL_FROM_DATABASE=RTL-8029(AS) ID_MODEL_FROM_DATABASE=RTL-8029(AS)
@ -57917,6 +57938,9 @@ pci:v000014F1d00008800sv00000070sd00007801*
pci:v000014F1d00008800sv00000070sd00009001* pci:v000014F1d00008800sv00000070sd00009001*
ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (Nova-T DVB-T) ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (Nova-T DVB-T)
pci:v000014F1d00008800sv00000070sd00009002*
ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (Nova-T DVB-T Model 909)
pci:v000014F1d00008800sv00000070sd00009200* pci:v000014F1d00008800sv00000070sd00009200*
ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (Nova-SE2 DVB-S) ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (Nova-SE2 DVB-S)
@ -60011,6 +60035,12 @@ pci:v000015B7d00005002*
pci:v000015B7d00005003* pci:v000015B7d00005003*
ID_MODEL_FROM_DATABASE=WD Black 2018 / PC SN520 NVMe SSD ID_MODEL_FROM_DATABASE=WD Black 2018 / PC SN520 NVMe SSD
pci:v000015B7d00005004*
ID_MODEL_FROM_DATABASE=PC SN520 NVMe SSD
pci:v000015B7d00005005*
ID_MODEL_FROM_DATABASE=PC SN520 NVMe SSD
pci:v000015B7d00005006* pci:v000015B7d00005006*
ID_MODEL_FROM_DATABASE=WD Black 2019/PC SN750 NVMe SSD ID_MODEL_FROM_DATABASE=WD Black 2019/PC SN750 NVMe SSD
@ -60020,6 +60050,9 @@ pci:v000015B7d00005009*
pci:v000015B7d00005009sv000015B7sd00005009* pci:v000015B7d00005009sv000015B7sd00005009*
ID_MODEL_FROM_DATABASE=WD Blue SN550 NVMe SSD ID_MODEL_FROM_DATABASE=WD Blue SN550 NVMe SSD
pci:v000015B7d0000500D*
ID_MODEL_FROM_DATABASE=WD Ultrastar DC SN340 NVMe SSD
pci:v000015B8* pci:v000015B8*
ID_VENDOR_FROM_DATABASE=ADDI-DATA GmbH ID_VENDOR_FROM_DATABASE=ADDI-DATA GmbH
@ -64328,6 +64361,12 @@ pci:v000018F4d000001A5*
pci:v000018F4d000001C5* pci:v000018F4d000001C5*
ID_MODEL_FROM_DATABASE=NT200A02 Network Adapter ID_MODEL_FROM_DATABASE=NT200A02 Network Adapter
pci:v000018F4d000001D5*
ID_MODEL_FROM_DATABASE=NT50B01 Network Adapter
pci:v000018F4d000001E5*
ID_MODEL_FROM_DATABASE=NT100A01 Network Adapter
pci:v000018F6* pci:v000018F6*
ID_VENDOR_FROM_DATABASE=NextIO ID_VENDOR_FROM_DATABASE=NextIO
@ -65459,6 +65498,9 @@ pci:v0000197Bd00000260*
pci:v0000197Bd00000368* pci:v0000197Bd00000368*
ID_MODEL_FROM_DATABASE=JMB368 IDE controller ID_MODEL_FROM_DATABASE=JMB368 IDE controller
pci:v0000197Bd00000585*
ID_MODEL_FROM_DATABASE=JMB58x AHCI SATA controller
pci:v0000197Bd00002360* pci:v0000197Bd00002360*
ID_MODEL_FROM_DATABASE=JMB360 AHCI Controller ID_MODEL_FROM_DATABASE=JMB360 AHCI Controller
@ -65877,7 +65919,7 @@ pci:v000019E5d00001710*
ID_MODEL_FROM_DATABASE=iBMA Virtual Network Adapter ID_MODEL_FROM_DATABASE=iBMA Virtual Network Adapter
pci:v000019E5d00001711* pci:v000019E5d00001711*
ID_MODEL_FROM_DATABASE=Hi1710 [iBMC Intelligent Management system chip w/VGA support] ID_MODEL_FROM_DATABASE=Hi171x Series [iBMC Intelligent Management system chip w/VGA support]
pci:v000019E5d00001822* pci:v000019E5d00001822*
ID_MODEL_FROM_DATABASE=Hi1822 Family (4*25GE) ID_MODEL_FROM_DATABASE=Hi1822 Family (4*25GE)
@ -66176,8 +66218,8 @@ pci:v00001A4Ad00001000*
pci:v00001A4Ad00001010* pci:v00001A4Ad00001010*
ID_MODEL_FROM_DATABASE=AMC EVR - Stockholm Timing Board ID_MODEL_FROM_DATABASE=AMC EVR - Stockholm Timing Board
pci:v00001A4Ad00001020* pci:v00001A4Ad00001030*
ID_MODEL_FROM_DATABASE=Cluster On Board (COB) Ethernet Switch ID_MODEL_FROM_DATABASE=PGPCard - Gen3 GIGe Interface
pci:v00001A4Ad00002000* pci:v00001A4Ad00002000*
ID_MODEL_FROM_DATABASE=PGPCard - 4 Lane ID_MODEL_FROM_DATABASE=PGPCard - 4 Lane
@ -66188,12 +66230,24 @@ pci:v00001A4Ad00002001*
pci:v00001A4Ad00002010* pci:v00001A4Ad00002010*
ID_MODEL_FROM_DATABASE=PCI-Express EVR ID_MODEL_FROM_DATABASE=PCI-Express EVR
pci:v00001A4Ad00002011*
ID_MODEL_FROM_DATABASE=PCI-Express EVR - TPR Version
pci:v00001A4Ad00002020* pci:v00001A4Ad00002020*
ID_MODEL_FROM_DATABASE=PGP-GEN3 PCIe ID_MODEL_FROM_DATABASE=PGP-GEN3 PCIe - 8 Lane Plus EVR
pci:v00001A4Ad00002030* pci:v00001A4Ad00002030*
ID_MODEL_FROM_DATABASE=AXI Stream DAQ PCIe card ID_MODEL_FROM_DATABASE=AXI Stream DAQ PCIe card
pci:v00001A4Ad00002040*
ID_MODEL_FROM_DATABASE=EXO PCIe TEM
pci:v00001A4Ad00003000*
ID_MODEL_FROM_DATABASE=COB DTM V1
pci:v00001A4Ad00003001*
ID_MODEL_FROM_DATABASE=COB DTM V2
pci:v00001A51* pci:v00001A51*
ID_VENDOR_FROM_DATABASE=Hectronic AB ID_VENDOR_FROM_DATABASE=Hectronic AB
@ -66692,6 +66746,9 @@ pci:v00001B1A*
pci:v00001B1Ad00000E70* pci:v00001B1Ad00000E70*
ID_MODEL_FROM_DATABASE=GRAPE ID_MODEL_FROM_DATABASE=GRAPE
pci:v00001B1C*
ID_VENDOR_FROM_DATABASE=Corsair
pci:v00001B21* pci:v00001B21*
ID_VENDOR_FROM_DATABASE=ASMedia Technology Inc. ID_VENDOR_FROM_DATABASE=ASMedia Technology Inc.
@ -66704,6 +66761,9 @@ pci:v00001B21d00000612*
pci:v00001B21d00000612sv00001849sd00000612* pci:v00001B21d00000612sv00001849sd00000612*
ID_MODEL_FROM_DATABASE=ASM1062 Serial ATA Controller (Motherboard) ID_MODEL_FROM_DATABASE=ASM1062 Serial ATA Controller (Motherboard)
pci:v00001B21d00001040*
ID_MODEL_FROM_DATABASE=ASM1040 XHCI Controller
pci:v00001B21d00001042* pci:v00001B21d00001042*
ID_MODEL_FROM_DATABASE=ASM1042 SuperSpeed USB Host Controller ID_MODEL_FROM_DATABASE=ASM1042 SuperSpeed USB Host Controller
@ -66935,6 +66995,12 @@ pci:v00001B4Bd00000640*
pci:v00001B4Bd00002241* pci:v00001B4Bd00002241*
ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller
pci:v00001B4Bd00002241sv00001028sd00002112*
ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller (BOSS-N1 Monolithic)
pci:v00001B4Bd00002241sv00001028sd00002113*
ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller (BOSS-N1 Modular)
pci:v00001B4Bd00002241sv00001D49sd00000306* pci:v00001B4Bd00002241sv00001D49sd00000306*
ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller (ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit) ID_MODEL_FROM_DATABASE=88NR2241 Non-Volatile memory controller (ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit)
@ -67139,6 +67205,36 @@ pci:v00001B94d0000E400*
pci:v00001B96* pci:v00001B96*
ID_VENDOR_FROM_DATABASE=Western Digital ID_VENDOR_FROM_DATABASE=Western Digital
pci:v00001B96d00002200*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN630 NVMe SSD
pci:v00001B96d00002201*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN630 NVMe SSD
pci:v00001B96d00002300*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN840 NVMe SSD
pci:v00001B96d00002400*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN640 NVMe SSD
pci:v00001B96d00002401*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN640 NVMe SSD
pci:v00001B96d00002402*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN640 NVMe SSD
pci:v00001B96d00002404*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN640 NVMe SSD
pci:v00001B96d00002500*
ID_MODEL_FROM_DATABASE=Ultrastar DC SN840 NVMe SSD
pci:v00001B96d00003714*
ID_MODEL_FROM_DATABASE=PC SN730 NVMe SSD
pci:v00001B96d00003734*
ID_MODEL_FROM_DATABASE=PC SN730 NVMe SSD
pci:v00001B9A* pci:v00001B9A*
ID_VENDOR_FROM_DATABASE=XAVi Technologies Corp. ID_VENDOR_FROM_DATABASE=XAVi Technologies Corp.
@ -67760,6 +67856,9 @@ pci:v00001CD2d00000305*
pci:v00001CD2d00000306* pci:v00001CD2d00000306*
ID_MODEL_FROM_DATABASE=Simulyzer-RT CompactPCI Serial CAN-2 card (CAN-FD) ID_MODEL_FROM_DATABASE=Simulyzer-RT CompactPCI Serial CAN-2 card (CAN-FD)
pci:v00001CD2d00000307*
ID_MODEL_FROM_DATABASE=Simulyzer-RT CompactPCI Serial DIO-2 card [Xilinx Zynq UltraScale+]
pci:v00001CD7* pci:v00001CD7*
ID_VENDOR_FROM_DATABASE=Nanjing Magewell Electronics Co., Ltd. ID_VENDOR_FROM_DATABASE=Nanjing Magewell Electronics Co., Ltd.
@ -68279,6 +68378,9 @@ pci:v00001D78d00001512sv00001D78sd00003107*
pci:v00001D7C* pci:v00001D7C*
ID_VENDOR_FROM_DATABASE=Aerotech, Inc. ID_VENDOR_FROM_DATABASE=Aerotech, Inc.
pci:v00001D7Cd00000001*
ID_MODEL_FROM_DATABASE=HyperWire Adapter
pci:v00001D82* pci:v00001D82*
ID_VENDOR_FROM_DATABASE=NETINT Technologies Inc. ID_VENDOR_FROM_DATABASE=NETINT Technologies Inc.
@ -68423,6 +68525,9 @@ pci:v00001DA1*
pci:v00001DA2* pci:v00001DA2*
ID_VENDOR_FROM_DATABASE=Sapphire Technology Limited ID_VENDOR_FROM_DATABASE=Sapphire Technology Limited
pci:v00001DA2d0000E26A*
ID_MODEL_FROM_DATABASE=Radeon R7 250
pci:v00001DA3* pci:v00001DA3*
ID_VENDOR_FROM_DATABASE=Habana Labs Ltd. ID_VENDOR_FROM_DATABASE=Habana Labs Ltd.
@ -68831,6 +68936,12 @@ pci:v00001E0Fd00000007sv00001028sd00002110*
pci:v00001E0Fd00000007sv00001E0Fsd00000001* pci:v00001E0Fd00000007sv00001E0Fsd00000001*
ID_MODEL_FROM_DATABASE=NVMe SSD Controller Cx6 (Generic NVMe CM6 RI 3.84TB) ID_MODEL_FROM_DATABASE=NVMe SSD Controller Cx6 (Generic NVMe CM6 RI 3.84TB)
pci:v00001E0Fd00000009*
ID_MODEL_FROM_DATABASE=NVMe SSD
pci:v00001E0Fd00000009sv00001E0Fsd00000001*
ID_MODEL_FROM_DATABASE=NVMe SSD (Toshiba RC500 NVMe SSD 500GB)
pci:v00001E17* pci:v00001E17*
ID_VENDOR_FROM_DATABASE=Arnold & Richter Cine Technik GmbH & Co. Betriebs KG ID_VENDOR_FROM_DATABASE=Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
@ -68867,12 +68978,99 @@ pci:v00001E36*
pci:v00001E36d00000001* pci:v00001E36d00000001*
ID_MODEL_FROM_DATABASE=T10 [CloudBlazer] ID_MODEL_FROM_DATABASE=T10 [CloudBlazer]
pci:v00001E36d00000002*
ID_MODEL_FROM_DATABASE=T11 [CloudBlazer]
pci:v00001E36d00000003*
ID_MODEL_FROM_DATABASE=T10s [CloudBlazer]
pci:v00001E36d00008011*
ID_MODEL_FROM_DATABASE=I10 [CloudBlazer]
pci:v00001E38* pci:v00001E38*
ID_VENDOR_FROM_DATABASE=Blaize, Inc ID_VENDOR_FROM_DATABASE=Blaize, Inc
pci:v00001E38d00000102* pci:v00001E38d00000102*
ID_MODEL_FROM_DATABASE=Xplorer X1600 ID_MODEL_FROM_DATABASE=Xplorer X1600
pci:v00001E3B*
ID_VENDOR_FROM_DATABASE=Shenzhen DAPU Microelectronics Co., Ltd
pci:v00001E3Bd00001098*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD
pci:v00001E3Bd00001098sv00001E3Bsd00000001*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 0.8TB (H2100))
pci:v00001E3Bd00001098sv00001E3Bsd00000002*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 0.96TB (H2200))
pci:v00001E3Bd00001098sv00001E3Bsd00000004*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 1.6TB (H2100))
pci:v00001E3Bd00001098sv00001E3Bsd00000005*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 1.92TB (H2200))
pci:v00001E3Bd00001098sv00001E3Bsd00000009*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 0.8TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd0000000A*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 0.96TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd0000000C*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 1.6TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd0000000D*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 1.92TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd00000014*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 3.2TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd00000015*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 3.84TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd00000021*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 6.4TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd00000022*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD U.2 7.68TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd00000061*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 0.8TB (H2100))
pci:v00001E3Bd00001098sv00001E3Bsd00000062*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 0.96TB (H2200))
pci:v00001E3Bd00001098sv00001E3Bsd00000064*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 1.6TB (H2100))
pci:v00001E3Bd00001098sv00001E3Bsd00000065*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 1.92TB (H2200))
pci:v00001E3Bd00001098sv00001E3Bsd0000006C*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 0.8TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd0000006D*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 0.96TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd0000006F*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 1.6TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd00000070*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 1.92TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd0000007C*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 3.2TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd0000007D*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 3.84TB (H3200))
pci:v00001E3Bd00001098sv00001E3Bsd0000007F*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 6.4TB (H3100))
pci:v00001E3Bd00001098sv00001E3Bsd00000080*
ID_MODEL_FROM_DATABASE=Haishen NVMe SSD (Enterprise NVMe SSD HHHL 7.68TB (H3200))
pci:v00001E3D* pci:v00001E3D*
ID_VENDOR_FROM_DATABASE=Burlywood, Inc ID_VENDOR_FROM_DATABASE=Burlywood, Inc
@ -68948,6 +69146,9 @@ pci:v00001E94*
pci:v00001E95* pci:v00001E95*
ID_VENDOR_FROM_DATABASE=Solid State Storage Technology Corporation ID_VENDOR_FROM_DATABASE=Solid State Storage Technology Corporation
pci:v00001EAB*
ID_VENDOR_FROM_DATABASE=Hefei DATANG Storage Technology Co.,LTD.
pci:v00001EAE* pci:v00001EAE*
ID_VENDOR_FROM_DATABASE=XFX Limited ID_VENDOR_FROM_DATABASE=XFX Limited
@ -69195,7 +69396,7 @@ pci:v00002646*
ID_VENDOR_FROM_DATABASE=Kingston Technology Company, Inc. ID_VENDOR_FROM_DATABASE=Kingston Technology Company, Inc.
pci:v00002646d00002263* pci:v00002646d00002263*
ID_MODEL_FROM_DATABASE=A2000, M.2, 500GB ID_MODEL_FROM_DATABASE=A2000 NVMe SSD
pci:v0000270B* pci:v0000270B*
ID_VENDOR_FROM_DATABASE=Xantel Corporation ID_VENDOR_FROM_DATABASE=Xantel Corporation
@ -73016,6 +73217,12 @@ pci:v00008086d00000A55sv00001028sd00001FE8*
pci:v00008086d00000A55sv00001028sd00001FE9* pci:v00008086d00000A55sv00001028sd00001FE9*
ID_MODEL_FROM_DATABASE=NVMe DC SSD [3DNAND, Beta Rock Controller] (Express Flash NVMe 4.0TB HHHL AIC (P4600)) ID_MODEL_FROM_DATABASE=NVMe DC SSD [3DNAND, Beta Rock Controller] (Express Flash NVMe 4.0TB HHHL AIC (P4600))
pci:v00008086d00000B26*
ID_MODEL_FROM_DATABASE=Thunderbolt 4 Bridge [Goshen Ridge 2020]
pci:v00008086d00000B27*
ID_MODEL_FROM_DATABASE=Thunderbolt 4 USB Controller [Goshen Ridge 2020]
pci:v00008086d00000B60* pci:v00008086d00000B60*
ID_MODEL_FROM_DATABASE=NVMe DC SSD [3DNAND, Beta Rock Controller] ID_MODEL_FROM_DATABASE=NVMe DC SSD [3DNAND, Beta Rock Controller]
@ -76127,6 +76334,18 @@ pci:v00008086d00001240*
pci:v00008086d0000124B* pci:v00008086d0000124B*
ID_MODEL_FROM_DATABASE=82380FB (MPCI2) Mobile Docking Controller ID_MODEL_FROM_DATABASE=82380FB (MPCI2) Mobile Docking Controller
pci:v00008086d0000124C*
ID_MODEL_FROM_DATABASE=Ethernet Connection E823-L for backplane
pci:v00008086d0000124D*
ID_MODEL_FROM_DATABASE=Ethernet Connection E823-L for SFP
pci:v00008086d0000124E*
ID_MODEL_FROM_DATABASE=Ethernet Connection E823-L/X557-AT 10GBASE-T
pci:v00008086d0000124F*
ID_MODEL_FROM_DATABASE=Ethernet Connection E823-L 1GbE
pci:v00008086d00001250* pci:v00008086d00001250*
ID_MODEL_FROM_DATABASE=430HX - 82439HX TXC [Triton II] ID_MODEL_FROM_DATABASE=430HX - 82439HX TXC [Triton II]
@ -76280,6 +76499,9 @@ pci:v00008086d0000151C*
pci:v00008086d0000151Csv0000108Esd00007B13* pci:v00008086d0000151Csv0000108Esd00007B13*
ID_MODEL_FROM_DATABASE=82599 10 Gigabit TN Network Connection (Dual 10GBASE-T LP) ID_MODEL_FROM_DATABASE=82599 10 Gigabit TN Network Connection (Dual 10GBASE-T LP)
pci:v00008086d0000151D*
ID_MODEL_FROM_DATABASE=Ethernet Connection E823-L for QSFP
pci:v00008086d00001520* pci:v00008086d00001520*
ID_MODEL_FROM_DATABASE=I350 Ethernet Controller Virtual Function ID_MODEL_FROM_DATABASE=I350 Ethernet Controller Virtual Function
@ -79466,6 +79688,9 @@ pci:v00008086d00001F27*
pci:v00008086d00001F2C* pci:v00008086d00001F2C*
ID_MODEL_FROM_DATABASE=Atom processor C2000 USB Enhanced Host Controller ID_MODEL_FROM_DATABASE=Atom processor C2000 USB Enhanced Host Controller
pci:v00008086d00001F2Csv00000200sd00001028*
ID_MODEL_FROM_DATABASE=Atom processor C2000 USB Enhanced Host Controller (Atom C2338 on Dell 0K8Y0N motherboard)
pci:v00008086d00001F2E* pci:v00008086d00001F2E*
ID_MODEL_FROM_DATABASE=Atom processor C2000 RAID SATA2 Controller ID_MODEL_FROM_DATABASE=Atom processor C2000 RAID SATA2 Controller
@ -81977,6 +82202,15 @@ pci:v00008086d00002520*
pci:v00008086d00002521* pci:v00008086d00002521*
ID_MODEL_FROM_DATABASE=82804AA MRH-S Memory Repeater Hub for SDRAM ID_MODEL_FROM_DATABASE=82804AA MRH-S Memory Repeater Hub for SDRAM
pci:v00008086d00002522*
ID_MODEL_FROM_DATABASE=NVMe Optane Memory Series
pci:v00008086d00002522sv00008086sd00003806*
ID_MODEL_FROM_DATABASE=NVMe Optane Memory Series (Optane Memory 16GB)
pci:v00008086d00002522sv00008086sd00003810*
ID_MODEL_FROM_DATABASE=NVMe Optane Memory Series (Optane Memory M10 16GB)
pci:v00008086d00002526* pci:v00008086d00002526*
ID_MODEL_FROM_DATABASE=Wireless-AC 9260 ID_MODEL_FROM_DATABASE=Wireless-AC 9260
@ -92663,12 +92897,21 @@ pci:v00008086d00009A13*
pci:v00008086d00009A14* pci:v00008086d00009A14*
ID_MODEL_FROM_DATABASE=11th Gen Core Processor Host Bridge/DRAM Registers ID_MODEL_FROM_DATABASE=11th Gen Core Processor Host Bridge/DRAM Registers
pci:v00008086d00009A17*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt USB Controller
pci:v00008086d00009A1B* pci:v00008086d00009A1B*
ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt NHI #0 ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt NHI #0
pci:v00008086d00009A1D* pci:v00008086d00009A1D*
ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt NHI #1 ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt NHI #1
pci:v00008086d00009A1F*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt NHI #0
pci:v00008086d00009A21*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt NHI #1
pci:v00008086d00009A23* pci:v00008086d00009A23*
ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt PCI Express Root Port #0 ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt PCI Express Root Port #0
@ -92681,11 +92924,23 @@ pci:v00008086d00009A27*
pci:v00008086d00009A29* pci:v00008086d00009A29*
ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt PCI Express Root Port #3 ID_MODEL_FROM_DATABASE=Tiger Lake-LP Thunderbolt PCI Express Root Port #3
pci:v00008086d00009A2B*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt PCI Express Root Port #0
pci:v00008086d00009A2D*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt PCI Express Root Port #1
pci:v00008086d00009A2F*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt PCI Express Root Port #2
pci:v00008086d00009A31*
ID_MODEL_FROM_DATABASE=Tiger Lake-H Thunderbolt PCI Express Root Port #3
pci:v00008086d00009A33* pci:v00008086d00009A33*
ID_MODEL_FROM_DATABASE=Tiger Lake Trace Hub ID_MODEL_FROM_DATABASE=Tiger Lake Trace Hub
pci:v00008086d00009A49* pci:v00008086d00009A49*
ID_MODEL_FROM_DATABASE=UHD Graphics ID_MODEL_FROM_DATABASE=Iris Xe Graphics
pci:v00008086d00009B41* pci:v00008086d00009B41*
ID_MODEL_FROM_DATABASE=UHD Graphics ID_MODEL_FROM_DATABASE=UHD Graphics

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
# #
# List of PCI ID's # List of PCI ID's
# #
# Version: 2020.10.25 # Version: 2020.11.14
# Date: 2020-10-25 03:15:01 # Date: 2020-11-14 03:15:02
# #
# Maintained by Albert Pool, Martin Mares, and other volunteers from # Maintained by Albert Pool, Martin Mares, and other volunteers from
# the PCI ID Project at https://pci-ids.ucw.cz/. # the PCI ID Project at https://pci-ids.ucw.cz/.
@ -70,6 +70,8 @@
018a LevelOne 018a LevelOne
0106 FPC-0106TX misprogrammed [RTL81xx] 0106 FPC-0106TX misprogrammed [RTL81xx]
01de Oxide Computer Company 01de Oxide Computer Company
# probably misprogrammed Intel Atom C2338 on Dell 0K8Y0N board
0200 Dell (wrong ID)
# 021b is not Compaq but there is a board misprogrammed # 021b is not Compaq but there is a board misprogrammed
021b Compaq Computer Corporation 021b Compaq Computer Corporation
8139 HNE-300 (RealTek RTL8139c) [iPaq Networking] 8139 HNE-300 (RealTek RTL8139c) [iPaq Networking]
@ -2728,6 +2730,7 @@
17aa 3643 Radeon R9 A375 17aa 3643 Radeon R9 A375
17aa 3801 Radeon R9 M275 17aa 3801 Radeon R9 M275
17aa 3824 Radeon R9 M375 17aa 3824 Radeon R9 M375
1da2 e26a Radeon R7 250
6821 Venus XT [Radeon HD 8870M / R9 M270X/M370X] 6821 Venus XT [Radeon HD 8870M / R9 M270X/M370X]
1002 031e FirePro SX4000 1002 031e FirePro SX4000
1028 05cc FirePro M5100 1028 05cc FirePro M5100
@ -3413,6 +3416,7 @@
148c 9380 Radeon R9 380 148c 9380 Radeon R9 380
# Make naming scheme consistent # Make naming scheme consistent
174b e308 Radeon R9 380 Nitro 4G D5 174b e308 Radeon R9 380 Nitro 4G D5
174b e315 Radeon R9 285
693b Tonga PRO GL [FirePro W7100 / Barco MXRT-7600] 693b Tonga PRO GL [FirePro W7100 / Barco MXRT-7600]
694c Polaris 22 XT [Radeon RX Vega M GH] 694c Polaris 22 XT [Radeon RX Vega M GH]
694e Polaris 22 XL [Radeon RX Vega M GL] 694e Polaris 22 XL [Radeon RX Vega M GL]
@ -3586,9 +3590,10 @@
7347 Navi 14 [Radeon Pro W5500M] 7347 Navi 14 [Radeon Pro W5500M]
734f Navi 14 [Radeon Pro W5300M] 734f Navi 14 [Radeon Pro W5300M]
7360 Navi 12 [Radeon Pro 5600M] 7360 Navi 12 [Radeon Pro 5600M]
73bf Navi 21 [Radeon RX 6900 Series] 73bf Navi 21 [Radeon RX 6800/6800 XT / 6900 XT]
73c3 Navi 23 73c3 Navi 22
73df Navi 22 73df Navi 22
73ff Navi 23
7833 RS350 Host Bridge 7833 RS350 Host Bridge
7834 RS350 [Radeon 9100 PRO/XT IGP] 7834 RS350 [Radeon 9100 PRO/XT IGP]
7835 RS350M [Mobility Radeon 9000 IGP] 7835 RS350M [Mobility Radeon 9000 IGP]
@ -9469,7 +9474,7 @@
1682 211c GeForce 6600 256MB DDR DUAL DVI TV 1682 211c GeForce 6600 256MB DDR DUAL DVI TV
00f3 NV43 [GeForce 6200] 00f3 NV43 [GeForce 6200]
00f4 NV43 [GeForce 6600 LE] 00f4 NV43 [GeForce 6600 LE]
00f5 G71 [GeForce 7800 GS AGP] 00f5 G70/G71 [GeForce 7800 GS AGP]
00f6 NV43 [GeForce 6800 GS/XT] 00f6 NV43 [GeForce 6800 GS/XT]
1682 217e XFX GeForce 6800 XTreme 256MB DDR3 AGP 1682 217e XFX GeForce 6800 XTreme 256MB DDR3 AGP
00f8 NV45GL [Quadro FX 3400/4400] 00f8 NV45GL [Quadro FX 3400/4400]
@ -11705,6 +11710,7 @@
128a GK208B 128a GK208B
128b GK208B [GeForce GT 710] 128b GK208B [GeForce GT 710]
1043 85f7 GT710-SL-1GD5 1043 85f7 GT710-SL-1GD5
1043 8770 GT710-4H-SL-2GD5
128c GK208B 128c GK208B
1290 GK208M [GeForce GT 730M] 1290 GK208M [GeForce GT 730M]
103c 2afa GeForce GT 730A 103c 2afa GeForce GT 730A
@ -12097,7 +12103,7 @@
21c4 TU116 [GeForce GTX 1660 SUPER] 21c4 TU116 [GeForce GTX 1660 SUPER]
21d1 TU116BM [GeForce GTX 1660 Ti Mobile] 21d1 TU116BM [GeForce GTX 1660 Ti Mobile]
2204 GA102 [GeForce RTX 3090] 2204 GA102 [GeForce RTX 3090]
2206 GA102 [GeForce RTX 3080 10GB / 20GB] 2206 GA102 [GeForce RTX 3080]
10de 146d GA102 [GeForce RTX 3080 20GB] 10de 146d GA102 [GeForce RTX 3080 20GB]
1462 3892 RTX 3080 10GB GAMING X TRIO 1462 3892 RTX 3080 10GB GAMING X TRIO
222b GA102 [GeForce RTX 3090 Engineering Sample] 222b GA102 [GeForce RTX 3090 Engineering Sample]
@ -12105,17 +12111,18 @@
2230 GA102GL [RTX A6000] 2230 GA102GL [RTX A6000]
223f GA102GL 223f GA102GL
2482 GA104 [GeForce RTX 3070 Ti] 2482 GA104 [GeForce RTX 3070 Ti]
2484 GA104 [GeForce RTX 3070 8GB / 16GB] 2484 GA104 [GeForce RTX 3070]
10de 146b GA104 [GeForce RTX 3070] 10de 146b GA104 [GeForce RTX 3070]
10de 14ae GA104 [GeForce RTX 3070 16GB] 10de 14ae GA104 [GeForce RTX 3070 16GB]
2486 GA104 [GeForce RTX 3060 Ti] 2486 GA104 [GeForce RTX 3060 Ti]
249c GA104M [GeForce RTX 3070 Mobile / Max-Q] 249c GA104M [GeForce RTX 3070 Mobile / Max-Q 8GB/16GB]
249d GA104M [GeForce RTX 3070 Mobile / Max-Q] 249d GA104M [GeForce RTX 3070 Mobile / Max-Q]
24ac GA104 [GeForce RTX 30x0 Engineering Sample] 24ac GA104 [GeForce RTX 30x0 Engineering Sample]
24ad GA104 [GeForce RTX 3060 Engineering Sample] 24ad GA104 [GeForce RTX 3060 Engineering Sample]
24af GA104 [GeForce RTX 3070 Engineering Sample] 24af GA104 [GeForce RTX 3070 Engineering Sample]
24bf GA104 [GeForce RTX 3070 Engineering Sample] 24bf GA104 [GeForce RTX 3070 Engineering Sample]
24dc GA104 [GeForce RTX 3070 16GB Engineering Sample] 24dc GA104M [GeForce RTX 3070 Mobile 16GB]
24dd GA104M [GeForce RTX 3070 Mobile / Max-Q]
252f GA106 [GeForce RTX 3060 Engineering Sample] 252f GA106 [GeForce RTX 3060 Engineering Sample]
25af GA107 [GeForce RTX 3050 Engineering Sample] 25af GA107 [GeForce RTX 3050 Engineering Sample]
10df Emulex Corporation 10df Emulex Corporation
@ -12349,6 +12356,7 @@
5288 RTS5288 PCI Express Card Reader 5288 RTS5288 PCI Express Card Reader
5289 RTL8411 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader
1043 1457 K55A Laptop 1043 1457 K55A Laptop
5762 RTS5763DL NVMe SSD Controller
8029 RTL-8029(AS) 8029 RTL-8029(AS)
10b8 2011 EZ-Card (SMC1208) 10b8 2011 EZ-Card (SMC1208)
10ec 8029 RTL-8029(AS) 10ec 8029 RTL-8029(AS)
@ -19546,6 +19554,7 @@
0070 6902 WinTV HVR-4000-HD 0070 6902 WinTV HVR-4000-HD
0070 7801 WinTV HVR-1800 MCE 0070 7801 WinTV HVR-1800 MCE
0070 9001 Nova-T DVB-T 0070 9001 Nova-T DVB-T
0070 9002 Nova-T DVB-T Model 909
0070 9200 Nova-SE2 DVB-S 0070 9200 Nova-SE2 DVB-S
0070 9202 Nova-S-Plus DVB-S 0070 9202 Nova-S-Plus DVB-S
0070 9402 WinTV-HVR1100 DVB-T/Hybrid 0070 9402 WinTV-HVR1100 DVB-T/Hybrid
@ -20255,9 +20264,12 @@
5001 WD Black NVMe SSD 5001 WD Black NVMe SSD
5002 WD Black 2018 / PC SN720 NVMe SSD 5002 WD Black 2018 / PC SN720 NVMe SSD
5003 WD Black 2018 / PC SN520 NVMe SSD 5003 WD Black 2018 / PC SN520 NVMe SSD
5004 PC SN520 NVMe SSD
5005 PC SN520 NVMe SSD
5006 WD Black 2019/PC SN750 NVMe SSD 5006 WD Black 2019/PC SN750 NVMe SSD
5009 WD Blue SN550 NVMe SSD 5009 WD Blue SN550 NVMe SSD
15b7 5009 WD Blue SN550 NVMe SSD 15b7 5009 WD Blue SN550 NVMe SSD
500d WD Ultrastar DC SN340 NVMe SSD
15b8 ADDI-DATA GmbH 15b8 ADDI-DATA GmbH
1001 APCI1516 SP controller (16 digi outputs) 1001 APCI1516 SP controller (16 digi outputs)
1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler)
@ -21743,6 +21755,8 @@
0185 NT40A01 Network Adapter 0185 NT40A01 Network Adapter
01a5 NT200A01 Network Adapter 01a5 NT200A01 Network Adapter
01c5 NT200A02 Network Adapter 01c5 NT200A02 Network Adapter
01d5 NT50B01 Network Adapter
01e5 NT100A01 Network Adapter
18f6 NextIO 18f6 NextIO
1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1000 [Nexsis] Switch Virtual P2P PCIe Bridge
1001 [Texsis] Switch Virtual P2P PCIe Bridge 1001 [Texsis] Switch Virtual P2P PCIe Bridge
@ -22137,6 +22151,7 @@
0250 JMC250 PCI Express Gigabit Ethernet Controller 0250 JMC250 PCI Express Gigabit Ethernet Controller
0260 JMC260 PCI Express Fast Ethernet Controller 0260 JMC260 PCI Express Fast Ethernet Controller
0368 JMB368 IDE controller 0368 JMB368 IDE controller
0585 JMB58x AHCI SATA controller
2360 JMB360 AHCI Controller 2360 JMB360 AHCI Controller
2361 JMB361 AHCI/IDE 2361 JMB361 AHCI/IDE
1462 7235 P965 Neo MS-7235 mainboard 1462 7235 P965 Neo MS-7235 mainboard
@ -22281,7 +22296,7 @@
19e5 d303 Hi1822 SP522 (2*8G FC) 19e5 d303 Hi1822 SP522 (2*8G FC)
19e5 d306 Hi1822 SP523 (2*8G FC) 19e5 d306 Hi1822 SP523 (2*8G FC)
1710 iBMA Virtual Network Adapter 1710 iBMA Virtual Network Adapter
1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] 1711 Hi171x Series [iBMC Intelligent Management system chip w/VGA support]
1822 Hi1822 Family (4*25GE) 1822 Hi1822 Family (4*25GE)
19e5 d129 Hi1822 SP570 (4*25GE) 19e5 d129 Hi1822 SP570 (4*25GE)
19e5 d136 Hi1822 SP580 (4*25GE) 19e5 d136 Hi1822 SP580 (4*25GE)
@ -22382,13 +22397,16 @@
1a4a SLAC National Accelerator Lab TID-AIR 1a4a SLAC National Accelerator Lab TID-AIR
1000 MCOR Power Supply Controller 1000 MCOR Power Supply Controller
1010 AMC EVR - Stockholm Timing Board 1010 AMC EVR - Stockholm Timing Board
1020 Cluster On Board (COB) Ethernet Switch 1030 PGPCard - Gen3 GIGe Interface
2000 PGPCard - 4 Lane 2000 PGPCard - 4 Lane
2001 PGPCard - 8 Lane Plus EVR 2001 PGPCard - 8 Lane Plus EVR
2010 PCI-Express EVR 2010 PCI-Express EVR
# PC-260-101-03 2011 PCI-Express EVR - TPR Version
2020 PGP-GEN3 PCIe 2020 PGP-GEN3 PCIe - 8 Lane Plus EVR
2030 AXI Stream DAQ PCIe card 2030 AXI Stream DAQ PCIe card
2040 EXO PCIe TEM
3000 COB DTM V1
3001 COB DTM V2
1a51 Hectronic AB 1a51 Hectronic AB
1a55 Rohde & Schwarz DVS GmbH 1a55 Rohde & Schwarz DVS GmbH
0010 SDStationOEM 0010 SDStationOEM
@ -22595,10 +22613,12 @@
1b13 Jaton Corp 1b13 Jaton Corp
1b1a K&F Computing Research Co. 1b1a K&F Computing Research Co.
0e70 GRAPE 0e70 GRAPE
1b1c Corsair
1b21 ASMedia Technology Inc. 1b21 ASMedia Technology Inc.
0611 ASM1061 SATA IDE Controller 0611 ASM1061 SATA IDE Controller
0612 ASM1062 Serial ATA Controller 0612 ASM1062 Serial ATA Controller
1849 0612 Motherboard 1849 0612 Motherboard
1040 ASM1040 XHCI Controller
1042 ASM1042 SuperSpeed USB Host Controller 1042 ASM1042 SuperSpeed USB Host Controller
1043 1059 K53SM motherboard 1043 1059 K53SM motherboard
1043 8488 P8B WS Motherboard 1043 8488 P8B WS Motherboard
@ -22678,6 +22698,8 @@
1b4b Marvell Technology Group Ltd. 1b4b Marvell Technology Group Ltd.
0640 88SE9128 SATA III 6Gb/s RAID Controller 0640 88SE9128 SATA III 6Gb/s RAID Controller
2241 88NR2241 Non-Volatile memory controller 2241 88NR2241 Non-Volatile memory controller
1028 2112 BOSS-N1 Monolithic
1028 2113 BOSS-N1 Modular
1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit 1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit
1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit 1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit
9120 88SE9120 SATA 6Gb/s Controller 9120 88SE9120 SATA 6Gb/s Controller
@ -22747,6 +22769,16 @@
1b94 Signatec / Dynamic Signals Corp 1b94 Signatec / Dynamic Signals Corp
e400 PX14400 Dual Xilinx Virtex5 based Digitizer e400 PX14400 Dual Xilinx Virtex5 based Digitizer
1b96 Western Digital 1b96 Western Digital
2200 Ultrastar DC SN630 NVMe SSD
2201 Ultrastar DC SN630 NVMe SSD
2300 Ultrastar DC SN840 NVMe SSD
2400 Ultrastar DC SN640 NVMe SSD
2401 Ultrastar DC SN640 NVMe SSD
2402 Ultrastar DC SN640 NVMe SSD
2404 Ultrastar DC SN640 NVMe SSD
2500 Ultrastar DC SN840 NVMe SSD
3714 PC SN730 NVMe SSD
3734 PC SN730 NVMe SSD
1b9a XAVi Technologies Corp. 1b9a XAVi Technologies Corp.
1baa QNAP Systems, Inc. 1baa QNAP Systems, Inc.
1bad ReFLEX CES 1bad ReFLEX CES
@ -22985,6 +23017,7 @@
0305 Simulyzer-RT CompactPCI Serial CAN-1 card 0305 Simulyzer-RT CompactPCI Serial CAN-1 card
# supports 8x CAN (-FD) interfaces # supports 8x CAN (-FD) interfaces
0306 Simulyzer-RT CompactPCI Serial CAN-2 card (CAN-FD) 0306 Simulyzer-RT CompactPCI Serial CAN-2 card (CAN-FD)
0307 Simulyzer-RT CompactPCI Serial DIO-2 card [Xilinx Zynq UltraScale+]
1cd7 Nanjing Magewell Electronics Co., Ltd. 1cd7 Nanjing Magewell Electronics Co., Ltd.
0010 Pro Capture Endpoint 0010 Pro Capture Endpoint
0014 PRO CAPTURE AIO 4K PLUS 0014 PRO CAPTURE AIO 4K PLUS
@ -23159,6 +23192,8 @@
1d78 3105 D5457 U.2 3.2TB NVMe SSD 1d78 3105 D5457 U.2 3.2TB NVMe SSD
1d78 3107 D5457 U.2 6.4TB NVMe SSD 1d78 3107 D5457 U.2 6.4TB NVMe SSD
1d7c Aerotech, Inc. 1d7c Aerotech, Inc.
# Fiber-optic HyperWire motion control bus from Aerotech.
0001 HyperWire Adapter
1d82 NETINT Technologies Inc. 1d82 NETINT Technologies Inc.
0101 Codensity D400 SSD 0101 Codensity D400 SSD
0102 Codensity D408 PCIe Gen4 NVMe SSD 0102 Codensity D408 PCIe Gen4 NVMe SSD
@ -23207,6 +23242,7 @@
0011 IO Bridge 0011 IO Bridge
1da1 Teko Telecom S.r.l. 1da1 Teko Telecom S.r.l.
1da2 Sapphire Technology Limited 1da2 Sapphire Technology Limited
e26a Radeon R7 250
1da3 Habana Labs Ltd. 1da3 Habana Labs Ltd.
0001 HL-1000 AI Inference Accelerator [Goya] 0001 HL-1000 AI Inference Accelerator [Goya]
# PCIe accelerator card for Deep Learning training tasks # PCIe accelerator card for Deep Learning training tasks
@ -23344,6 +23380,8 @@
1028 210f Dell Ent NVMe FIPS CM6 MU 3.2TB 1028 210f Dell Ent NVMe FIPS CM6 MU 3.2TB
1028 2110 Dell Ent NVMe FIPS CM6 MU 6.4TB 1028 2110 Dell Ent NVMe FIPS CM6 MU 6.4TB
1e0f 0001 Generic NVMe CM6 RI 3.84TB 1e0f 0001 Generic NVMe CM6 RI 3.84TB
0009 NVMe SSD
1e0f 0001 Toshiba RC500 NVMe SSD 500GB
1e17 Arnold & Richter Cine Technik GmbH & Co. Betriebs KG 1e17 Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
1e24 Squirrels Research Labs 1e24 Squirrels Research Labs
0101 Acorn CLE-101 0101 Acorn CLE-101
@ -23359,9 +23397,38 @@
1e26 Fujitsu Client Computing Limited 1e26 Fujitsu Client Computing Limited
1e36 Shanghai Enflame Technology Co. Ltd 1e36 Shanghai Enflame Technology Co. Ltd
0001 T10 [CloudBlazer] 0001 T10 [CloudBlazer]
0002 T11 [CloudBlazer]
0003 T10s [CloudBlazer]
8011 I10 [CloudBlazer]
# nee Thinci, Inc # nee Thinci, Inc
1e38 Blaize, Inc 1e38 Blaize, Inc
0102 Xplorer X1600 0102 Xplorer X1600
1e3b Shenzhen DAPU Microelectronics Co., Ltd
1098 Haishen NVMe SSD
1e3b 0001 Enterprise NVMe SSD U.2 0.8TB (H2100)
1e3b 0002 Enterprise NVMe SSD U.2 0.96TB (H2200)
1e3b 0004 Enterprise NVMe SSD U.2 1.6TB (H2100)
1e3b 0005 Enterprise NVMe SSD U.2 1.92TB (H2200)
1e3b 0009 Enterprise NVMe SSD U.2 0.8TB (H3100)
1e3b 000a Enterprise NVMe SSD U.2 0.96TB (H3200)
1e3b 000c Enterprise NVMe SSD U.2 1.6TB (H3100)
1e3b 000d Enterprise NVMe SSD U.2 1.92TB (H3200)
1e3b 0014 Enterprise NVMe SSD U.2 3.2TB (H3100)
1e3b 0015 Enterprise NVMe SSD U.2 3.84TB (H3200)
1e3b 0021 Enterprise NVMe SSD U.2 6.4TB (H3100)
1e3b 0022 Enterprise NVMe SSD U.2 7.68TB (H3200)
1e3b 0061 Enterprise NVMe SSD HHHL 0.8TB (H2100)
1e3b 0062 Enterprise NVMe SSD HHHL 0.96TB (H2200)
1e3b 0064 Enterprise NVMe SSD HHHL 1.6TB (H2100)
1e3b 0065 Enterprise NVMe SSD HHHL 1.92TB (H2200)
1e3b 006c Enterprise NVMe SSD HHHL 0.8TB (H3100)
1e3b 006d Enterprise NVMe SSD HHHL 0.96TB (H3200)
1e3b 006f Enterprise NVMe SSD HHHL 1.6TB (H3100)
1e3b 0070 Enterprise NVMe SSD HHHL 1.92TB (H3200)
1e3b 007c Enterprise NVMe SSD HHHL 3.2TB (H3100)
1e3b 007d Enterprise NVMe SSD HHHL 3.84TB (H3200)
1e3b 007f Enterprise NVMe SSD HHHL 6.4TB (H3100)
1e3b 0080 Enterprise NVMe SSD HHHL 7.68TB (H3200)
1e3d Burlywood, Inc 1e3d Burlywood, Inc
1e49 Yangtze Memory Technologies Co.,Ltd 1e49 Yangtze Memory Technologies Co.,Ltd
1e4b MAXIO Technology (Hangzhou) Ltd. 1e4b MAXIO Technology (Hangzhou) Ltd.
@ -23389,6 +23456,7 @@
# aka SED Systems # aka SED Systems
1e94 Calian SED 1e94 Calian SED
1e95 Solid State Storage Technology Corporation 1e95 Solid State Storage Technology Corporation
1eab Hefei DATANG Storage Technology Co.,LTD.
1eae XFX Limited 1eae XFX Limited
1eb1 VeriSilicon Inc 1eb1 VeriSilicon Inc
1001 Video Accelerator 1001 Video Accelerator
@ -23473,7 +23541,7 @@
2348 Racore 2348 Racore
2010 8142 100VG/AnyLAN 2010 8142 100VG/AnyLAN
2646 Kingston Technology Company, Inc. 2646 Kingston Technology Company, Inc.
2263 A2000, M.2, 500GB 2263 A2000 NVMe SSD
270b Xantel Corporation 270b Xantel Corporation
270f Chaintech Computer Co. Ltd 270f Chaintech Computer Co. Ltd
2711 AVID Technology Inc. 2711 AVID Technology Inc.
@ -24895,6 +24963,8 @@
1028 1fe7 Express Flash NVMe 3.2TB 2.5" U.2 (P4600) 1028 1fe7 Express Flash NVMe 3.2TB 2.5" U.2 (P4600)
1028 1fe8 Express Flash NVMe 2.0TB HHHL AIC (P4600) 1028 1fe8 Express Flash NVMe 2.0TB HHHL AIC (P4600)
1028 1fe9 Express Flash NVMe 4.0TB HHHL AIC (P4600) 1028 1fe9 Express Flash NVMe 4.0TB HHHL AIC (P4600)
0b26 Thunderbolt 4 Bridge [Goshen Ridge 2020]
0b27 Thunderbolt 4 USB Controller [Goshen Ridge 2020]
0b60 NVMe DC SSD [3DNAND, Beta Rock Controller] 0b60 NVMe DC SSD [3DNAND, Beta Rock Controller]
1028 2060 NVMe SED MU U.2 1.6TB (P5600) 1028 2060 NVMe SED MU U.2 1.6TB (P5600)
1028 2061 NVMe SED MU U.2 3.2TB (P5600) 1028 2061 NVMe SED MU U.2 3.2TB (P5600)
@ -25933,6 +26003,10 @@
123f 82466GX Integrated Hot-Plug Controller (IHPC) 123f 82466GX Integrated Hot-Plug Controller (IHPC)
1240 82752 (752) AGP Graphics Accelerator 1240 82752 (752) AGP Graphics Accelerator
124b 82380FB (MPCI2) Mobile Docking Controller 124b 82380FB (MPCI2) Mobile Docking Controller
124c Ethernet Connection E823-L for backplane
124d Ethernet Connection E823-L for SFP
124e Ethernet Connection E823-L/X557-AT 10GBASE-T
124f Ethernet Connection E823-L 1GbE
1250 430HX - 82439HX TXC [Triton II] 1250 430HX - 82439HX TXC [Triton II]
1360 82806AA PCI64 Hub PCI Bridge 1360 82806AA PCI64 Hub PCI Bridge
1361 82806AA PCI64 Hub Controller (HRes) 1361 82806AA PCI64 Hub Controller (HRes)
@ -25984,6 +26058,7 @@
151b CVL2510 Thunderbolt Controller [Light Peak 2C 2010] 151b CVL2510 Thunderbolt Controller [Light Peak 2C 2010]
151c 82599 10 Gigabit TN Network Connection 151c 82599 10 Gigabit TN Network Connection
108e 7b13 Dual 10GBASE-T LP 108e 7b13 Dual 10GBASE-T LP
151d Ethernet Connection E823-L for QSFP
1520 I350 Ethernet Controller Virtual Function 1520 I350 Ethernet Controller Virtual Function
1521 I350 Gigabit Network Connection 1521 I350 Gigabit Network Connection
1028 0602 Gigabit 2P I350-t LOM 1028 0602 Gigabit 2P I350-t LOM
@ -27055,6 +27130,7 @@
1f26 Atom processor C2000 RAID SATA2 Controller 1f26 Atom processor C2000 RAID SATA2 Controller
1f27 Atom processor C2000 RAID SATA2 Controller 1f27 Atom processor C2000 RAID SATA2 Controller
1f2c Atom processor C2000 USB Enhanced Host Controller 1f2c Atom processor C2000 USB Enhanced Host Controller
0200 1028 Atom C2338 on Dell 0K8Y0N motherboard
1f2e Atom processor C2000 RAID SATA2 Controller 1f2e Atom processor C2000 RAID SATA2 Controller
1f2f Atom processor C2000 RAID SATA2 Controller 1f2f Atom processor C2000 RAID SATA2 Controller
1f30 Atom processor C2000 2-Port IDE SATA3 Controller 1f30 Atom processor C2000 2-Port IDE SATA3 Controller
@ -27897,6 +27973,9 @@
250f 82820 820 (Camino) Chipset AGP Bridge 250f 82820 820 (Camino) Chipset AGP Bridge
2520 82805AA MTH Memory Translator Hub 2520 82805AA MTH Memory Translator Hub
2521 82804AA MRH-S Memory Repeater Hub for SDRAM 2521 82804AA MRH-S Memory Repeater Hub for SDRAM
2522 NVMe Optane Memory Series
8086 3806 Optane Memory 16GB
8086 3810 Optane Memory M10 16GB
2526 Wireless-AC 9260 2526 Wireless-AC 9260
2530 82850 850 (Tehama) Chipset Host Bridge (MCH) 2530 82850 850 (Tehama) Chipset Host Bridge (MCH)
1028 00c7 Dimension 8100 1028 00c7 Dimension 8100
@ -31462,14 +31541,21 @@
9a0b Volume Management Device NVMe RAID Controller 9a0b Volume Management Device NVMe RAID Controller
9a13 Tiger Lake-LP Thunderbolt USB Controller 9a13 Tiger Lake-LP Thunderbolt USB Controller
9a14 11th Gen Core Processor Host Bridge/DRAM Registers 9a14 11th Gen Core Processor Host Bridge/DRAM Registers
9a17 Tiger Lake-H Thunderbolt USB Controller
9a1b Tiger Lake-LP Thunderbolt NHI #0 9a1b Tiger Lake-LP Thunderbolt NHI #0
9a1d Tiger Lake-LP Thunderbolt NHI #1 9a1d Tiger Lake-LP Thunderbolt NHI #1
9a1f Tiger Lake-H Thunderbolt NHI #0
9a21 Tiger Lake-H Thunderbolt NHI #1
9a23 Tiger Lake-LP Thunderbolt PCI Express Root Port #0 9a23 Tiger Lake-LP Thunderbolt PCI Express Root Port #0
9a25 Tiger Lake-LP Thunderbolt PCI Express Root Port #1 9a25 Tiger Lake-LP Thunderbolt PCI Express Root Port #1
9a27 Tiger Lake-LP Thunderbolt PCI Express Root Port #2 9a27 Tiger Lake-LP Thunderbolt PCI Express Root Port #2
9a29 Tiger Lake-LP Thunderbolt PCI Express Root Port #3 9a29 Tiger Lake-LP Thunderbolt PCI Express Root Port #3
9a2b Tiger Lake-H Thunderbolt PCI Express Root Port #0
9a2d Tiger Lake-H Thunderbolt PCI Express Root Port #1
9a2f Tiger Lake-H Thunderbolt PCI Express Root Port #2
9a31 Tiger Lake-H Thunderbolt PCI Express Root Port #3
9a33 Tiger Lake Trace Hub 9a33 Tiger Lake Trace Hub
9a49 UHD Graphics 9a49 Iris Xe Graphics
9b41 UHD Graphics 9b41 UHD Graphics
9b44 10th Gen Core Processor Host Bridge/DRAM Registers 9b44 10th Gen Core Processor Host Bridge/DRAM Registers
9b54 10th Gen Core Processor Host Bridge/DRAM Registers 9b54 10th Gen Core Processor Host Bridge/DRAM Registers
@ -33166,6 +33252,9 @@ C 08 Generic system peripheral
05 SD Host controller 05 SD Host controller
06 IOMMU 06 IOMMU
80 System peripheral 80 System peripheral
99 Timing Card
# PTP Grandmaster Source Clock
01 TAP Timing Card
C 09 Input device controller C 09 Input device controller
00 Keyboard controller 00 Keyboard controller
01 Digitizer Pen 01 Digitizer Pen

View File

@ -251,8 +251,16 @@
request. Be aware that turning off caching comes at a performance penalty, which is particularly high request. Be aware that turning off caching comes at a performance penalty, which is particularly high
when DNSSEC is used. If <literal>no-negative</literal>, only positive answers are cached.</para> when DNSSEC is used. If <literal>no-negative</literal>, only positive answers are cached.</para>
<para>Note that caching is turned off implicitly if the configured DNS server is on a host-local IP address <para>Note that caching is turned off by default for host-local DNS servers.
(such as 127.0.0.1 or ::1), in order to avoid duplicate local caching.</para></listitem> See <varname>CacheFromLocalhost=</varname> for details.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>CacheFromLocalhost=</varname></term>
<listitem><para>Takes a boolean as argument. If <literal>no</literal> (the default), and response cames from
host-local IP address (such as 127.0.0.1 or ::1), the result wouldn't be cached in order to avoid
potential duplicate local caching.</para>
</listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -3194,7 +3194,6 @@ public_programs += executable(
c_args : '-DLOG_REALM=LOG_REALM_UDEV', c_args : '-DLOG_REALM=LOG_REALM_UDEV',
include_directories : includes, include_directories : includes,
link_with : [libudev_core, link_with : [libudev_core,
libsystemd_network,
libudev_static], libudev_static],
dependencies : [versiondep, dependencies : [versiondep,
threads, threads,

View File

@ -108,7 +108,6 @@ fuzzers += [
[['src/fuzz/fuzz-udev-rules.c'], [['src/fuzz/fuzz-udev-rules.c'],
[libudev_core, [libudev_core,
libudev_static, libudev_static,
libsystemd_network,
libshared], libshared],
[threads, [threads,
libacl]], libacl]],

View File

@ -109,7 +109,7 @@ if conf.get('ENABLE_HOMED') == 1
if install_sysconfdir if install_sysconfdir
install_data('homed.conf', install_data('homed.conf',
install_dir : sysconfdir) install_dir : pkgsysconfdir)
endif endif
endif endif

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_infiniband.h> #include <linux/if_infiniband.h>
#include <net/ethernet.h>
#include <net/if_arp.h> #include <net/if_arp.h>
#include "sd-device.h" #include "sd-device.h"
@ -8,7 +9,7 @@
#include "dhcp-identifier.h" #include "dhcp-identifier.h"
#include "dhcp6-protocol.h" #include "dhcp6-protocol.h"
#include "network-internal.h" #include "network-util.h"
#include "siphash24.h" #include "siphash24.h"
#include "sparse-endian.h" #include "sparse-endian.h"
#include "stdio-util.h" #include "stdio-util.h"

View File

@ -17,6 +17,7 @@ sources = files('''
arp-util.h arp-util.h
arp-util.c arp-util.c
network-internal.c network-internal.c
network-internal.h
sd-ndisc.c sd-ndisc.c
ndisc-internal.h ndisc-internal.h
ndisc-router.h ndisc-router.h
@ -42,10 +43,7 @@ sources = files('''
sd-lldp.c sd-lldp.c
'''.split()) '''.split())
network_internal_h = files('network-internal.h')
libsystemd_network = static_library( libsystemd_network = static_library(
'systemd-network', 'systemd-network',
sources, sources,
network_internal_h,
include_directories : includes) include_directories : includes)

View File

@ -4,658 +4,15 @@
#include <linux/if.h> #include <linux/if.h>
#include <netinet/ether.h> #include <netinet/ether.h>
#include "sd-id128.h"
#include "sd-ndisc.h" #include "sd-ndisc.h"
#include "alloc-util.h" #include "alloc-util.h"
#include "arphrd-list.h"
#include "condition.h"
#include "conf-parser.h"
#include "device-util.h"
#include "dhcp-lease-internal.h" #include "dhcp-lease-internal.h"
#include "env-util.h" #include "extract-word.h"
#include "ether-addr-util.h"
#include "hexdecoct.h" #include "hexdecoct.h"
#include "log.h" #include "log.h"
#include "network-internal.h" #include "network-internal.h"
#include "parse-util.h" #include "parse-util.h"
#include "siphash24.h"
#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
#include "util.h"
const char *net_get_name_persistent(sd_device *device) {
const char *name, *field;
assert(device);
/* fetch some persistent data unique (on this machine) to this device */
FOREACH_STRING(field, "ID_NET_NAME_ONBOARD", "ID_NET_NAME_SLOT", "ID_NET_NAME_PATH", "ID_NET_NAME_MAC")
if (sd_device_get_property_value(device, field, &name) >= 0)
return name;
return NULL;
}
#define HASH_KEY SD_ID128_MAKE(d3,1e,48,fa,90,fe,4b,4c,9d,af,d5,d7,a1,b1,2e,8a)
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result) {
size_t l, sz = 0;
const char *name;
int r;
uint8_t *v;
assert(device);
/* net_get_name_persistent() will return one of the device names based on stable information about
* the device. If this is not available, we fall back to using the actual device name. */
name = net_get_name_persistent(device);
if (!name && use_sysname)
(void) sd_device_get_sysname(device, &name);
if (!name)
return log_device_debug_errno(device, SYNTHETIC_ERRNO(ENODATA),
"No stable identifying information found");
log_device_debug(device, "Using \"%s\" as stable identifying information", name);
l = strlen(name);
sz = sizeof(sd_id128_t) + l;
v = newa(uint8_t, sz);
/* Fetch some persistent data unique to this machine */
r = sd_id128_get_machine((sd_id128_t*) v);
if (r < 0)
return r;
memcpy(v + sizeof(sd_id128_t), name, l);
/* Let's hash the machine ID plus the device name. We use
* a fixed, but originally randomly created hash key here. */
*result = htole64(siphash24(v, sz, HASH_KEY.bytes));
return 0;
}
static bool net_condition_test_strv(char * const *patterns, const char *string) {
char * const *p;
bool match = false, has_positive_rule = false;
if (strv_isempty(patterns))
return true;
STRV_FOREACH(p, patterns) {
const char *q = *p;
bool invert;
invert = *q == '!';
q += invert;
if (!invert)
has_positive_rule = true;
if (string && fnmatch(q, string, 0) == 0) {
if (invert)
return false;
else
match = true;
}
}
return has_positive_rule ? match : true;
}
static bool net_condition_test_ifname(char * const *patterns, const char *ifname, char * const *alternative_names) {
if (net_condition_test_strv(patterns, ifname))
return true;
char * const *p;
STRV_FOREACH(p, alternative_names)
if (net_condition_test_strv(patterns, *p))
return true;
return false;
}
static int net_condition_test_property(char * const *match_property, sd_device *device) {
char * const *p;
if (strv_isempty(match_property))
return true;
STRV_FOREACH(p, match_property) {
_cleanup_free_ char *key = NULL;
const char *val, *dev_val;
bool invert, v;
invert = **p == '!';
val = strchr(*p + invert, '=');
if (!val)
return -EINVAL;
key = strndup(*p + invert, val - *p - invert);
if (!key)
return -ENOMEM;
val++;
v = device &&
sd_device_get_property_value(device, key, &dev_val) >= 0 &&
fnmatch(val, dev_val, 0) == 0;
if (invert ? v : !v)
return false;
}
return true;
}
static const char *const wifi_iftype_table[NL80211_IFTYPE_MAX+1] = {
[NL80211_IFTYPE_ADHOC] = "ad-hoc",
[NL80211_IFTYPE_STATION] = "station",
[NL80211_IFTYPE_AP] = "ap",
[NL80211_IFTYPE_AP_VLAN] = "ap-vlan",
[NL80211_IFTYPE_WDS] = "wds",
[NL80211_IFTYPE_MONITOR] = "monitor",
[NL80211_IFTYPE_MESH_POINT] = "mesh-point",
[NL80211_IFTYPE_P2P_CLIENT] = "p2p-client",
[NL80211_IFTYPE_P2P_GO] = "p2p-go",
[NL80211_IFTYPE_P2P_DEVICE] = "p2p-device",
[NL80211_IFTYPE_OCB] = "ocb",
[NL80211_IFTYPE_NAN] = "nan",
};
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(wifi_iftype, enum nl80211_iftype);
char *link_get_type_string(unsigned short iftype, sd_device *device) {
const char *t, *devtype;
char *p;
if (device &&
sd_device_get_devtype(device, &devtype) >= 0 &&
!isempty(devtype))
return strdup(devtype);
t = arphrd_to_name(iftype);
if (!t)
return NULL;
p = strdup(t);
if (!p)
return NULL;
ascii_strlower(p);
return p;
}
bool net_match_config(Set *match_mac,
Set *match_permanent_mac,
char * const *match_paths,
char * const *match_drivers,
char * const *match_iftypes,
char * const *match_names,
char * const *match_property,
char * const *match_wifi_iftype,
char * const *match_ssid,
Set *match_bssid,
sd_device *device,
const struct ether_addr *dev_mac,
const struct ether_addr *dev_permanent_mac,
const char *dev_driver,
unsigned short dev_iftype,
const char *dev_name,
char * const *alternative_names,
enum nl80211_iftype dev_wifi_iftype,
const char *dev_ssid,
const struct ether_addr *dev_bssid) {
_cleanup_free_ char *dev_iftype_str;
const char *dev_path = NULL;
dev_iftype_str = link_get_type_string(dev_iftype, device);
if (device) {
const char *mac_str;
(void) sd_device_get_property_value(device, "ID_PATH", &dev_path);
if (!dev_driver)
(void) sd_device_get_property_value(device, "ID_NET_DRIVER", &dev_driver);
if (!dev_name)
(void) sd_device_get_sysname(device, &dev_name);
if (!dev_mac &&
sd_device_get_sysattr_value(device, "address", &mac_str) >= 0)
dev_mac = ether_aton(mac_str);
}
if (match_mac && (!dev_mac || !set_contains(match_mac, dev_mac)))
return false;
if (match_permanent_mac &&
(!dev_permanent_mac ||
ether_addr_is_null(dev_permanent_mac) ||
!set_contains(match_permanent_mac, dev_permanent_mac)))
return false;
if (!net_condition_test_strv(match_paths, dev_path))
return false;
if (!net_condition_test_strv(match_drivers, dev_driver))
return false;
if (!net_condition_test_strv(match_iftypes, dev_iftype_str))
return false;
if (!net_condition_test_ifname(match_names, dev_name, alternative_names))
return false;
if (!net_condition_test_property(match_property, device))
return false;
if (!net_condition_test_strv(match_wifi_iftype, wifi_iftype_to_string(dev_wifi_iftype)))
return false;
if (!net_condition_test_strv(match_ssid, dev_ssid))
return false;
if (match_bssid && (!dev_bssid || !set_contains(match_bssid, dev_bssid)))
return false;
return true;
}
int config_parse_net_condition(const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
ConditionType cond = ltype;
Condition **list = data, *c;
bool negate;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*list = condition_free_list_type(*list, cond);
return 0;
}
negate = rvalue[0] == '!';
if (negate)
rvalue++;
c = condition_new(cond, rvalue, false, negate);
if (!c)
return log_oom();
/* Drop previous assignment. */
*list = condition_free_list_type(*list, cond);
LIST_PREPEND(conditions, *list, c);
return 0;
}
int config_parse_match_strv(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*sv = strv_free(*sv);
return 0;
}
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
return 0;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}
int config_parse_match_ifnames(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, 0);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, 0,
"Failed to parse interface name list: %s", rvalue);
return 0;
}
if (!ifname_valid_full(word, ltype)) {
log_syntax(unit, LOG_ERR, filename, line, 0,
"Interface name is not valid or too long, ignoring assignment: %s", word);
continue;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}
int config_parse_match_property(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNQUOTE);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, 0,
"Invalid syntax, ignoring: %s", rvalue);
return 0;
}
if (!env_assignment_is_valid(word)) {
log_syntax(unit, LOG_ERR, filename, line, 0,
"Invalid property or value, ignoring assignment: %s", word);
continue;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}
int config_parse_ifalias(const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
char **s = data;
_cleanup_free_ char *n = NULL;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
n = strdup(rvalue);
if (!n)
return log_oom();
if (!ascii_is_valid(n) || strlen(n) >= IFALIASZ) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Interface alias is not ASCII clean or is too long, ignoring assignment: %s", rvalue);
return 0;
}
if (isempty(n))
*s = mfree(*s);
else
free_and_replace(*s, n);
return 0;
}
int config_parse_hwaddr(const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
_cleanup_free_ struct ether_addr *n = NULL;
struct ether_addr **hwaddr = data;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
n = new0(struct ether_addr, 1);
if (!n)
return log_oom();
r = ether_addr_from_string(rvalue, n);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Not a valid MAC address, ignoring assignment: %s", rvalue);
return 0;
}
free_and_replace(*hwaddr, n);
return 0;
}
int config_parse_hwaddrs(const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
_cleanup_set_free_free_ Set *s = NULL;
const char *p = rvalue;
Set **hwaddrs = data;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
/* Empty assignment resets the list */
*hwaddrs = set_free_free(*hwaddrs);
return 0;
}
s = set_new(&ether_addr_hash_ops);
if (!s)
return log_oom();
for (;;) {
_cleanup_free_ char *word = NULL;
_cleanup_free_ struct ether_addr *n = NULL;
r = extract_first_word(&p, &word, NULL, 0);
if (r == 0)
break;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
return 0;
}
n = new(struct ether_addr, 1);
if (!n)
return log_oom();
r = ether_addr_from_string(word, n);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Not a valid MAC address, ignoring: %s", word);
continue;
}
r = set_put(s, n);
if (r < 0)
return log_oom();
if (r > 0)
n = NULL; /* avoid cleanup */
}
r = set_ensure_allocated(hwaddrs, &ether_addr_hash_ops);
if (r < 0)
return log_oom();
r = set_move(*hwaddrs, s);
if (r < 0)
return log_oom();
return 0;
}
int config_parse_bridge_port_priority(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
uint16_t i;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
r = safe_atou16(rvalue, &i);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r,
"Failed to parse bridge port priority, ignoring: %s", rvalue);
return 0;
}
if (i > LINK_BRIDGE_PORT_PRIORITY_MAX) {
log_syntax(unit, LOG_ERR, filename, line, r,
"Bridge port priority is larger than maximum %u, ignoring: %s", LINK_BRIDGE_PORT_PRIORITY_MAX, rvalue);
return 0;
}
*((uint16_t *)data) = i;
return 0;
}
size_t serialize_in_addrs(FILE *f, size_t serialize_in_addrs(FILE *f,
const struct in_addr *addresses, const struct in_addr *addresses,

View File

@ -1,53 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once #pragma once
#include <linux/nl80211.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include "sd-device.h"
#include "sd-dhcp-lease.h" #include "sd-dhcp-lease.h"
#include "conf-parser.h"
#include "set.h"
#include "strv.h"
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
char *link_get_type_string(unsigned short iftype, sd_device *device);
bool net_match_config(Set *match_mac,
Set *match_permanent_mac,
char * const *match_paths,
char * const *match_drivers,
char * const *match_iftypes,
char * const *match_names,
char * const *match_property,
char * const *match_wifi_iftype,
char * const *match_ssid,
Set *match_bssid,
sd_device *device,
const struct ether_addr *dev_mac,
const struct ether_addr *dev_permanent_mac,
const char *dev_driver,
unsigned short dev_iftype,
const char *dev_name,
char * const *alternative_names,
enum nl80211_iftype dev_wifi_iftype,
const char *dev_ssid,
const struct ether_addr *dev_bssid);
CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
CONFIG_PARSER_PROTOTYPE(config_parse_match_strv);
CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames);
CONFIG_PARSER_PROTOTYPE(config_parse_match_property);
CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result);
const char *net_get_name_persistent(sd_device *device);
size_t serialize_in_addrs(FILE *f, size_t serialize_in_addrs(FILE *f,
const struct in_addr *addresses, const struct in_addr *addresses,
size_t size, size_t size,

View File

@ -21,10 +21,10 @@
#include "hexdecoct.h" #include "hexdecoct.h"
#include "hostname-util.h" #include "hostname-util.h"
#include "in-addr-util.h" #include "in-addr-util.h"
#include "network-internal.h"
#include "random-util.h" #include "random-util.h"
#include "socket-util.h" #include "socket-util.h"
#include "string-table.h" #include "string-table.h"
#include "strv.h"
#include "util.h" #include "util.h"
#include "web-util.h" #include "web-util.h"

View File

@ -1,8 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-id128.h"
#include "alloc-util.h" #include "alloc-util.h"
#include "arphrd-list.h"
#include "device-util.h"
#include "fd-util.h" #include "fd-util.h"
#include "network-util.h" #include "network-util.h"
#include "siphash24.h"
#include "sparse-endian.h"
#include "string-table.h" #include "string-table.h"
#include "strv.h" #include "strv.h"
@ -103,3 +109,72 @@ int parse_operational_state_range(const char *str, LinkOperationalStateRange *ou
return 0; return 0;
} }
char *link_get_type_string(sd_device *device, unsigned short iftype) {
const char *t;
char *p;
if (device &&
sd_device_get_devtype(device, &t) >= 0 &&
!isempty(t))
return strdup(t);
t = arphrd_to_name(iftype);
if (!t)
return NULL;
p = strdup(t);
if (!p)
return NULL;
return ascii_strlower(p);
}
const char *net_get_name_persistent(sd_device *device) {
const char *name, *field;
assert(device);
/* fetch some persistent data unique (on this machine) to this device */
FOREACH_STRING(field, "ID_NET_NAME_ONBOARD", "ID_NET_NAME_SLOT", "ID_NET_NAME_PATH", "ID_NET_NAME_MAC")
if (sd_device_get_property_value(device, field, &name) >= 0)
return name;
return NULL;
}
#define HASH_KEY SD_ID128_MAKE(d3,1e,48,fa,90,fe,4b,4c,9d,af,d5,d7,a1,b1,2e,8a)
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result) {
size_t l, sz = 0;
const char *name;
int r;
uint8_t *v;
assert(device);
/* net_get_name_persistent() will return one of the device names based on stable information about
* the device. If this is not available, we fall back to using the actual device name. */
name = net_get_name_persistent(device);
if (!name && use_sysname)
(void) sd_device_get_sysname(device, &name);
if (!name)
return log_device_debug_errno(device, SYNTHETIC_ERRNO(ENODATA),
"No stable identifying information found");
log_device_debug(device, "Using \"%s\" as stable identifying information", name);
l = strlen(name);
sz = sizeof(sd_id128_t) + l;
v = newa(uint8_t, sz);
/* Fetch some persistent data unique to this machine */
r = sd_id128_get_machine((sd_id128_t*) v);
if (r < 0)
return r;
memcpy(v + sizeof(sd_id128_t), name, l);
/* Let's hash the machine ID plus the device name. We use
* a fixed, but originally randomly created hash key here. */
*result = htole64(siphash24(v, sz, HASH_KEY.bytes));
return 0;
}

View File

@ -1,6 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once #pragma once
#include <inttypes.h>
#include <stdbool.h>
#include "sd-device.h"
#include "sd-network.h" #include "sd-network.h"
#include "macro.h" #include "macro.h"
@ -58,3 +62,7 @@ typedef struct LinkOperationalStateRange {
LINK_OPERSTATE_ROUTABLE } LINK_OPERSTATE_ROUTABLE }
int parse_operational_state_range(const char *str, LinkOperationalStateRange *out); int parse_operational_state_range(const char *str, LinkOperationalStateRange *out);
char *link_get_type_string(sd_device *device, unsigned short iftype);
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result);
const char *net_get_name_persistent(sd_device *device);

View File

@ -171,7 +171,7 @@ systemd_networkd_wait_online_sources = files('''
wait-online/manager.c wait-online/manager.c
wait-online/manager.h wait-online/manager.h
wait-online/wait-online.c wait-online/wait-online.c
'''.split()) + network_internal_h '''.split())
networkctl_sources = files('networkctl.c') networkctl_sources = files('networkctl.c')
@ -214,7 +214,6 @@ if conf.get('ENABLE_NETWORKD') == 1
libnetworkd_core = static_library( libnetworkd_core = static_library(
'networkd-core', 'networkd-core',
sources, sources,
network_internal_h,
networkd_gperf_c, networkd_gperf_c,
networkd_network_gperf_c, networkd_network_gperf_c,
netdev_gperf_c, netdev_gperf_c,

View File

@ -4,7 +4,6 @@
#include "bridge.h" #include "bridge.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h" #include "networkd-manager.h"
#include "string-table.h" #include "string-table.h"
#include "vlan-util.h" #include "vlan-util.h"
@ -342,6 +341,47 @@ int config_parse_bridge_igmp_version(
return 0; return 0;
} }
int config_parse_bridge_port_priority(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
uint16_t i;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
/* This is used in networkd-network-gperf.gperf. */
r = safe_atou16(rvalue, &i);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to parse bridge port priority, ignoring: %s", rvalue);
return 0;
}
if (i > LINK_BRIDGE_PORT_PRIORITY_MAX) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Bridge port priority is larger than maximum %u, ignoring: %s",
LINK_BRIDGE_PORT_PRIORITY_MAX, rvalue);
return 0;
}
*((uint16_t *)data) = i;
return 0;
}
static void bridge_init(NetDev *n) { static void bridge_init(NetDev *n) {
Bridge *b; Bridge *b;

View File

@ -7,6 +7,9 @@
#include "conf-parser.h" #include "conf-parser.h"
#include "netdev.h" #include "netdev.h"
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
typedef struct Bridge { typedef struct Bridge {
NetDev meta; NetDev meta;
@ -45,3 +48,4 @@ MulticastRouter multicast_router_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router); CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router);
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version); CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version);
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);

View File

@ -12,7 +12,6 @@
#include "macsec.h" #include "macsec.h"
#include "memory-util.h" #include "memory-util.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h" #include "networkd-manager.h"
#include "path-util.h" #include "path-util.h"
#include "socket-util.h" #include "socket-util.h"

View File

@ -7,23 +7,23 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#include "bond.h" #include "bond.h"
#include "bridge.h" #include "bridge.h"
#include "conf-parser.h" #include "conf-parser.h"
#include "fou-tunnel.h"
#include "geneve.h" #include "geneve.h"
#include "ipvlan.h" #include "ipvlan.h"
#include "l2tp-tunnel.h"
#include "macsec.h" #include "macsec.h"
#include "macvlan.h" #include "macvlan.h"
#include "net-condition.h"
#include "netdev.h"
#include "tunnel.h" #include "tunnel.h"
#include "tuntap.h" #include "tuntap.h"
#include "veth.h" #include "veth.h"
#include "vlan-util.h" #include "vlan-util.h"
#include "vlan.h" #include "vlan.h"
#include "vxlan.h"
#include "vrf.h" #include "vrf.h"
#include "netdev.h"
#include "network-internal.h"
#include "vxcan.h" #include "vxcan.h"
#include "vxlan.h"
#include "wireguard.h" #include "wireguard.h"
#include "fou-tunnel.h"
#include "l2tp-tunnel.h"
#include "xfrm.h" #include "xfrm.h"
%} %}
struct ConfigPerfItem; struct ConfigPerfItem;

View File

@ -23,7 +23,6 @@
#include "netdev.h" #include "netdev.h"
#include "netdevsim.h" #include "netdevsim.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h"
#include "networkd-manager.h" #include "networkd-manager.h"
#include "nlmon.h" #include "nlmon.h"
#include "path-lookup.h" #include "path-lookup.h"

View File

@ -44,6 +44,7 @@
#include "main-func.h" #include "main-func.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h" #include "network-internal.h"
#include "network-util.h"
#include "pager.h" #include "pager.h"
#include "parse-util.h" #include "parse-util.h"
#include "pretty-print.h" #include "pretty-print.h"
@ -704,7 +705,7 @@ static int list_links(int argc, char *argv[], void *userdata) {
setup_state = strdup("unmanaged"); setup_state = strdup("unmanaged");
setup_state_to_color(setup_state, &on_color_setup, &off_color_setup); setup_state_to_color(setup_state, &on_color_setup, &off_color_setup);
t = link_get_type_string(links[i].iftype, links[i].sd_device); t = link_get_type_string(links[i].sd_device, links[i].iftype);
r = table_add_many(table, r = table_add_many(table,
TABLE_INT, links[i].ifindex, TABLE_INT, links[i].ifindex,
@ -1428,7 +1429,7 @@ static int link_status_one(
(void) sd_device_get_property_value(info->sd_device, "ID_MODEL", &model); (void) sd_device_get_property_value(info->sd_device, "ID_MODEL", &model);
} }
t = link_get_type_string(info->iftype, info->sd_device); t = link_get_type_string(info->sd_device, info->iftype);
(void) sd_network_link_get_network_file(info->ifindex, &network); (void) sd_network_link_get_network_file(info->ifindex, &network);

View File

@ -537,7 +537,7 @@ static bool link_is_static_address_configured(const Link *link, const Address *a
return false; return false;
} }
static bool link_address_is_dynamic(const Link *link, const Address *address) { bool link_address_is_dynamic(const Link *link, const Address *address) {
Route *route; Route *route;
assert(link); assert(link);
@ -1257,60 +1257,6 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message,
return 1; return 1;
} }
int link_serialize_addresses(Link *link, FILE *f) {
bool space = false;
Address *a;
assert(link);
fputs("ADDRESSES=", f);
SET_FOREACH(a, link->addresses) {
_cleanup_free_ char *address_str = NULL;
if (in_addr_to_string(a->family, &a->in_addr, &address_str) < 0)
continue;
fprintf(f, "%s%s/%u", space ? " " : "", address_str, a->prefixlen);
space = true;
}
fputc('\n', f);
return 0;
}
int link_deserialize_addresses(Link *link, const char *addresses) {
int r;
assert(link);
for (const char *p = addresses;; ) {
_cleanup_(address_freep) Address *tmp = NULL;
_cleanup_free_ char *address_str = NULL;
r = extract_first_word(&p, &address_str, NULL, 0);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to parse ADDRESSES=: %m");
if (r == 0)
return 0;
r = address_new(&tmp);
if (r < 0)
return log_oom();
r = in_addr_prefix_from_string_auto(address_str, &tmp->family, &tmp->in_addr, &tmp->prefixlen);
if (r < 0) {
log_link_debug_errno(link, r, "Failed to parse address, ignoring: %s", address_str);
continue;
}
r = address_add(link, tmp, NULL);
if (r < 0)
log_link_debug_errno(link, r, "Failed to add address %s, ignoring: %m", address_str);
}
return 0;
}
static void static_address_on_acd(sd_ipv4acd *acd, int event, void *userdata) { static void static_address_on_acd(sd_ipv4acd *acd, int event, void *userdata) {
_cleanup_free_ char *pretty = NULL; _cleanup_free_ char *pretty = NULL;
Address *address; Address *address;

View File

@ -62,8 +62,7 @@ DEFINE_NETWORK_SECTION_FUNCTIONS(Address, address_free);
int link_set_addresses(Link *link); int link_set_addresses(Link *link);
int link_drop_addresses(Link *link); int link_drop_addresses(Link *link);
int link_drop_foreign_addresses(Link *link); int link_drop_foreign_addresses(Link *link);
int link_serialize_addresses(Link *link, FILE *f); bool link_address_is_dynamic(const Link *link, const Address *address);
int link_deserialize_addresses(Link *link, const char *addresses);
void ipv4_dad_unref(Link *link); void ipv4_dad_unref(Link *link);
int ipv4_dad_stop(Link *link); int ipv4_dad_stop(Link *link);

View File

@ -17,7 +17,7 @@
#include "networkd-manager.h" #include "networkd-manager.h"
#include "networkd-network.h" #include "networkd-network.h"
#include "string-table.h" #include "string-table.h"
#include "string-util.h" #include "strv.h"
#include "sysctl-util.h" #include "sysctl-util.h"
#include "web-util.h" #include "web-util.h"
@ -1161,7 +1161,7 @@ static int dhcp4_set_hostname(Link *link) {
else { else {
r = gethostname_strict(&hostname); r = gethostname_strict(&hostname);
if (r < 0 && r != -ENXIO) /* ENXIO: no hostname set or hostname is "localhost" */ if (r < 0 && r != -ENXIO) /* ENXIO: no hostname set or hostname is "localhost" */
return r; return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to get hostname: %m");
hn = hostname; hn = hostname;
} }
@ -1169,60 +1169,9 @@ static int dhcp4_set_hostname(Link *link) {
r = sd_dhcp_client_set_hostname(link->dhcp_client, hn); r = sd_dhcp_client_set_hostname(link->dhcp_client, hn);
if (r == -EINVAL && hostname) if (r == -EINVAL && hostname)
/* Ignore error when the machine's hostname is not suitable to send in DHCP packet. */ /* Ignore error when the machine's hostname is not suitable to send in DHCP packet. */
log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set hostname from kernel hostname, ignoring: %m"); log_link_debug_errno(link, r, "DHCP4 CLIENT: Failed to set hostname from kernel hostname, ignoring: %m");
else if (r < 0) else if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set hostname: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set hostname: %m");
return 0;
}
static bool promote_secondaries_enabled(const char *ifname) {
_cleanup_free_ char *promote_secondaries_sysctl = NULL;
char *promote_secondaries_path;
int r;
promote_secondaries_path = strjoina("net/ipv4/conf/", ifname, "/promote_secondaries");
r = sysctl_read(promote_secondaries_path, &promote_secondaries_sysctl);
if (r < 0) {
log_debug_errno(r, "Cannot read sysctl %s", promote_secondaries_path);
return false;
}
truncate_nl(promote_secondaries_sysctl);
r = parse_boolean(promote_secondaries_sysctl);
if (r < 0)
log_warning_errno(r, "Cannot parse sysctl %s with content %s as boolean", promote_secondaries_path, promote_secondaries_sysctl);
return r > 0;
}
/* dhcp4_set_promote_secondaries will ensure this interface has
* the "promote_secondaries" option in the kernel set. If this sysctl
* is not set DHCP will work only as long as the IP address does not
* changes between leases. The kernel will remove all secondary IP
* addresses of an interface otherwise. The way systemd-network works
* is that the new IP of a lease is added as a secondary IP and when
* the primary one expires it relies on the kernel to promote the
* secondary IP. See also https://github.com/systemd/systemd/issues/7163
*/
static int dhcp4_set_promote_secondaries(Link *link) {
int r;
assert(link);
/* check if the kernel has promote_secondaries enabled for our
* interface. If it is not globally enabled or enabled for the
* specific interface we must either enable it.
*/
if (!(promote_secondaries_enabled("all") || promote_secondaries_enabled(link->ifname))) {
char *promote_secondaries_path = NULL;
log_link_debug(link, "promote_secondaries is unset, setting it");
promote_secondaries_path = strjoina("net/ipv4/conf/", link->ifname, "/promote_secondaries");
r = sysctl_write(promote_secondaries_path, "1");
if (r < 0)
log_link_warning_errno(link, r, "cannot set sysctl %s to 1", promote_secondaries_path);
return r > 0;
}
return 0; return 0;
} }
@ -1252,7 +1201,7 @@ static int dhcp4_set_client_identifier(Link *link) {
duid->raw_data_len > 0 ? duid->raw_data : NULL, duid->raw_data_len > 0 ? duid->raw_data : NULL,
duid->raw_data_len); duid->raw_data_len);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set IAID+DUID: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set IAID+DUID: %m");
break; break;
} }
case DHCP_CLIENT_ID_DUID_ONLY: { case DHCP_CLIENT_ID_DUID_ONLY: {
@ -1268,7 +1217,7 @@ static int dhcp4_set_client_identifier(Link *link) {
duid->raw_data_len > 0 ? duid->raw_data : NULL, duid->raw_data_len > 0 ? duid->raw_data : NULL,
duid->raw_data_len); duid->raw_data_len);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set DUID: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set DUID: %m");
break; break;
} }
case DHCP_CLIENT_ID_MAC: { case DHCP_CLIENT_ID_MAC: {
@ -1286,7 +1235,7 @@ static int dhcp4_set_client_identifier(Link *link) {
hw_addr, hw_addr,
hw_addr_len); hw_addr_len);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set client ID: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set client ID: %m");
break; break;
} }
default: default:
@ -1296,23 +1245,27 @@ static int dhcp4_set_client_identifier(Link *link) {
return 0; return 0;
} }
static int dhcp4_init(Link *link) { static int dhcp4_set_request_address(Link *link) {
int r; Address *a;
assert(link); assert(link);
assert(link->network);
assert(link->dhcp_client);
if (link->dhcp_client) if (!FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
return 0; return 0;
r = sd_dhcp_client_new(&link->dhcp_client, link->network->dhcp_anonymize); SET_FOREACH(a, link->addresses_foreign) {
if (r < 0) if (a->family != AF_INET)
return r; continue;
if (link_address_is_dynamic(link, a))
r = sd_dhcp_client_attach_event(link->dhcp_client, link->manager->event, 0); break;
if (r < 0) }
return r;
if (!a)
return 0; return 0;
return sd_dhcp_client_set_request_address(link->dhcp_client, &a->in_addr.in);
} }
int dhcp4_configure(Link *link) { int dhcp4_configure(Link *link) {
@ -1326,45 +1279,45 @@ int dhcp4_configure(Link *link) {
if (!link_dhcp4_enabled(link)) if (!link_dhcp4_enabled(link))
return 0; return 0;
r = dhcp4_set_promote_secondaries(link); if (!link->dhcp_client) {
r = sd_dhcp_client_new(&link->dhcp_client, link->network->dhcp_anonymize);
if (r < 0) if (r < 0)
return r; return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to allocate DHCP4 client: %m");
r = dhcp4_init(link); r = sd_dhcp_client_attach_event(link->dhcp_client, link->manager->event, 0);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to initialize DHCP4 client: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to attach event to DHCP4 client: %m");
}
r = sd_dhcp_client_set_mac(link->dhcp_client, r = sd_dhcp_client_set_mac(link->dhcp_client,
link->hw_addr.addr.bytes, link->hw_addr.addr.bytes,
link->bcast_addr.length > 0 ? link->bcast_addr.addr.bytes : NULL, link->bcast_addr.length > 0 ? link->bcast_addr.addr.bytes : NULL,
link->hw_addr.length, link->iftype); link->hw_addr.length, link->iftype);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set MAC address: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set MAC address: %m");
r = sd_dhcp_client_set_ifindex(link->dhcp_client, link->ifindex); r = sd_dhcp_client_set_ifindex(link->dhcp_client, link->ifindex);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set ifindex: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set ifindex: %m");
r = sd_dhcp_client_set_callback(link->dhcp_client, dhcp4_handler, link); r = sd_dhcp_client_set_callback(link->dhcp_client, dhcp4_handler, link);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set callback: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set callback: %m");
r = sd_dhcp_client_set_request_broadcast(link->dhcp_client, r = sd_dhcp_client_set_request_broadcast(link->dhcp_client, link->network->dhcp_broadcast);
link->network->dhcp_broadcast);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for broadcast: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for broadcast: %m");
if (link->mtu) { if (link->mtu > 0) {
r = sd_dhcp_client_set_mtu(link->dhcp_client, link->mtu); r = sd_dhcp_client_set_mtu(link->dhcp_client, link->mtu);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set MTU: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set MTU: %m");
} }
if (link->network->dhcp_use_mtu) { if (link->network->dhcp_use_mtu) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_INTERFACE_MTU);
SD_DHCP_OPTION_INTERFACE_MTU);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for MTU: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for MTU: %m");
} }
/* NOTE: even if this variable is called "use", it also "sends" PRL /* NOTE: even if this variable is called "use", it also "sends" PRL
@ -1373,39 +1326,37 @@ int dhcp4_configure(Link *link) {
/* NOTE: when using Anonymize=yes, routes PRL options are sent /* NOTE: when using Anonymize=yes, routes PRL options are sent
* by default, so they don't need to be added here. */ * by default, so they don't need to be added here. */
if (link->network->dhcp_use_routes && !link->network->dhcp_anonymize) { if (link->network->dhcp_use_routes && !link->network->dhcp_anonymize) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_STATIC_ROUTE);
SD_DHCP_OPTION_STATIC_ROUTE);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for static route: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for static route: %m");
r = sd_dhcp_client_set_request_option(link->dhcp_client, r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE);
SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for classless static route: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for classless static route: %m");
} }
if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO && !link->network->dhcp_anonymize) { if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO && !link->network->dhcp_anonymize) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_DOMAIN_SEARCH_LIST); r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_DOMAIN_SEARCH_LIST);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for domain search list: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for domain search list: %m");
} }
if (link->network->dhcp_use_ntp) { if (link->network->dhcp_use_ntp) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_NTP_SERVER); r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_NTP_SERVER);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for NTP server: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for NTP server: %m");
} }
if (link->network->dhcp_use_sip) { if (link->network->dhcp_use_sip) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_SIP_SERVER); r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_SIP_SERVER);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for SIP server: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for SIP server: %m");
} }
if (link->network->dhcp_use_timezone) { if (link->network->dhcp_use_timezone) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_NEW_TZDB_TIMEZONE); r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_NEW_TZDB_TIMEZONE);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for timezone: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for timezone: %m");
} }
SET_FOREACH(request_options, link->network->dhcp_request_options) { SET_FOREACH(request_options, link->network->dhcp_request_options) {
@ -1413,7 +1364,7 @@ int dhcp4_configure(Link *link) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, option); r = sd_dhcp_client_set_request_option(link->dhcp_client, option);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for '%u': %m", option); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for '%u': %m", option);
} }
ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_client_send_options) { ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_client_send_options) {
@ -1421,7 +1372,7 @@ int dhcp4_configure(Link *link) {
if (r == -EEXIST) if (r == -EEXIST)
continue; continue;
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set send option: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set send option: %m");
} }
ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_client_send_vendor_options) { ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_client_send_vendor_options) {
@ -1429,7 +1380,7 @@ int dhcp4_configure(Link *link) {
if (r == -EEXIST) if (r == -EEXIST)
continue; continue;
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set send option: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set send option: %m");
} }
r = dhcp4_set_hostname(link); r = dhcp4_set_hostname(link);
@ -1440,49 +1391,52 @@ int dhcp4_configure(Link *link) {
r = sd_dhcp_client_set_vendor_class_identifier(link->dhcp_client, r = sd_dhcp_client_set_vendor_class_identifier(link->dhcp_client,
link->network->dhcp_vendor_class_identifier); link->network->dhcp_vendor_class_identifier);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set vendor class identifier: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set vendor class identifier: %m");
} }
if (link->network->dhcp_mudurl) { if (link->network->dhcp_mudurl) {
r = sd_dhcp_client_set_mud_url(link->dhcp_client, r = sd_dhcp_client_set_mud_url(link->dhcp_client, link->network->dhcp_mudurl);
link->network->dhcp_mudurl);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set MUD URL: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set MUD URL: %m");
} }
if (link->network->dhcp_user_class) { if (link->network->dhcp_user_class) {
r = sd_dhcp_client_set_user_class(link->dhcp_client, (const char **) link->network->dhcp_user_class); r = sd_dhcp_client_set_user_class(link->dhcp_client, (const char **) link->network->dhcp_user_class);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set user class: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set user class: %m");
} }
if (link->network->dhcp_client_port) { if (link->network->dhcp_client_port > 0) {
r = sd_dhcp_client_set_client_port(link->dhcp_client, link->network->dhcp_client_port); r = sd_dhcp_client_set_client_port(link->dhcp_client, link->network->dhcp_client_port);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set listen port: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set listen port: %m");
} }
if (link->network->dhcp_max_attempts > 0) { if (link->network->dhcp_max_attempts > 0) {
r = sd_dhcp_client_set_max_attempts(link->dhcp_client, link->network->dhcp_max_attempts); r = sd_dhcp_client_set_max_attempts(link->dhcp_client, link->network->dhcp_max_attempts);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set max attempts: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set max attempts: %m");
} }
if (link->network->dhcp_ip_service_type > 0) { if (link->network->dhcp_ip_service_type > 0) {
r = sd_dhcp_client_set_service_type(link->dhcp_client, link->network->dhcp_ip_service_type); r = sd_dhcp_client_set_service_type(link->dhcp_client, link->network->dhcp_ip_service_type);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set IP service type: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set IP service type: %m");
} }
if (link->network->dhcp_fallback_lease_lifetime > 0) { if (link->network->dhcp_fallback_lease_lifetime > 0) {
r = sd_dhcp_client_set_fallback_lease_lifetime(link->dhcp_client, link->network->dhcp_fallback_lease_lifetime); r = sd_dhcp_client_set_fallback_lease_lifetime(link->dhcp_client, link->network->dhcp_fallback_lease_lifetime);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed set to lease lifetime: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed set to lease lifetime: %m");
} }
r = dhcp4_set_request_address(link);
if (r < 0)
return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to set initial DHCPv4 address: %m");
r = dhcp4_configure_dad(link); r = dhcp4_configure_dad(link);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to configure service type: %m"); return log_link_warning_errno(link, r, "DHCP4 CLIENT: Failed to configure service type: %m");
return dhcp4_set_client_identifier(link); return dhcp4_set_client_identifier(link);
} }
@ -1512,30 +1466,6 @@ int dhcp4_update_mac(Link *link) {
return 0; return 0;
} }
int link_deserialize_dhcp4(Link *link, const char *dhcp4_address) {
union in_addr_union address;
int r;
assert(link);
if (isempty(dhcp4_address))
return 0;
r = in_addr_from_string(AF_INET, dhcp4_address, &address);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to parse DHCPv4 address: %s", dhcp4_address);
r = dhcp4_init(link);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to initialize DHCPv4 client: %m");
r = sd_dhcp_client_set_request_address(link->dhcp_client, &address.in);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to set initial DHCPv4 address %s: %m", dhcp4_address);
return 0;
}
int config_parse_dhcp_max_attempts( int config_parse_dhcp_max_attempts(
const char *unit, const char *unit,
const char *filename, const char *filename,

View File

@ -20,8 +20,6 @@ typedef enum DHCPClientIdentifier {
int dhcp4_configure(Link *link); int dhcp4_configure(Link *link);
int dhcp4_update_mac(Link *link); int dhcp4_update_mac(Link *link);
int link_deserialize_dhcp4(Link *link, const char *dhcp4_address);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_client_identifier); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_client_identifier);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_acl_ip_address); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_acl_ip_address);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_max_attempts); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_max_attempts);

View File

@ -13,7 +13,6 @@
#include "hashmap.h" #include "hashmap.h"
#include "hostname-util.h" #include "hostname-util.h"
#include "missing_network.h" #include "missing_network.h"
#include "network-internal.h"
#include "networkd-address.h" #include "networkd-address.h"
#include "networkd-dhcp6.h" #include "networkd-dhcp6.h"
#include "networkd-link.h" #include "networkd-link.h"

View File

@ -142,25 +142,6 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
} }
} }
static int ipv4ll_init(Link *link) {
int r;
assert(link);
if (link->ipv4ll)
return 0;
r = sd_ipv4ll_new(&link->ipv4ll);
if (r < 0)
return r;
r = sd_ipv4ll_attach_event(link->ipv4ll, link->manager->event, 0);
if (r < 0)
return r;
return 0;
}
int ipv4ll_configure(Link *link) { int ipv4ll_configure(Link *link) {
uint64_t seed; uint64_t seed;
int r; int r;
@ -170,10 +151,16 @@ int ipv4ll_configure(Link *link) {
if (!link_ipv4ll_enabled(link, ADDRESS_FAMILY_IPV4 | ADDRESS_FAMILY_FALLBACK_IPV4)) if (!link_ipv4ll_enabled(link, ADDRESS_FAMILY_IPV4 | ADDRESS_FAMILY_FALLBACK_IPV4))
return 0; return 0;
r = ipv4ll_init(link); if (!link->ipv4ll) {
r = sd_ipv4ll_new(&link->ipv4ll);
if (r < 0) if (r < 0)
return r; return r;
r = sd_ipv4ll_attach_event(link->ipv4ll, link->manager->event, 0);
if (r < 0)
return r;
}
if (link->sd_device && if (link->sd_device &&
net_get_unique_predictable_data(link->sd_device, true, &seed) >= 0) { net_get_unique_predictable_data(link->sd_device, true, &seed) >= 0) {
r = sd_ipv4ll_set_address_seed(link->ipv4ll, seed); r = sd_ipv4ll_set_address_seed(link->ipv4ll, seed);
@ -224,52 +211,6 @@ int ipv4ll_update_mac(Link *link) {
return 0; return 0;
} }
int link_serialize_ipv4ll(Link *link, FILE *f) {
struct in_addr address;
int r;
assert(link);
if (!link->ipv4ll)
return 0;
r = sd_ipv4ll_get_address(link->ipv4ll, &address);
if (r == -ENOENT)
return 0;
if (r < 0)
return r;
fputs("IPV4LL_ADDRESS=", f);
serialize_in_addrs(f, &address, 1, false, NULL);
fputc('\n', f);
return 0;
}
int link_deserialize_ipv4ll(Link *link, const char *ipv4ll_address) {
union in_addr_union address;
int r;
assert(link);
if (isempty(ipv4ll_address))
return 0;
r = in_addr_from_string(AF_INET, ipv4ll_address, &address);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to parse IPv4LL address: %s", ipv4ll_address);
r = ipv4ll_init(link);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to initialize IPv4LL client: %m");
r = sd_ipv4ll_set_address(link->ipv4ll, &address.in);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to set initial IPv4LL address %s: %m", ipv4ll_address);
return 0;
}
int config_parse_ipv4ll( int config_parse_ipv4ll(
const char* unit, const char* unit,
const char *filename, const char *filename,

View File

@ -9,7 +9,5 @@ typedef struct Link Link;
int ipv4ll_configure(Link *link); int ipv4ll_configure(Link *link);
int ipv4ll_update_mac(Link *link); int ipv4ll_update_mac(Link *link);
int link_serialize_ipv4ll(Link *link, FILE *f);
int link_deserialize_ipv4ll(Link *link, const char *ipv4ll_address);
CONFIG_PARSER_PROTOTYPE(config_parse_ipv4ll); CONFIG_PARSER_PROTOTYPE(config_parse_ipv4ll);

View File

@ -2415,69 +2415,6 @@ int link_initialized(Link *link, sd_device *device) {
return 0; return 0;
} }
static int link_load(Link *link) {
_cleanup_free_ char *network_file = NULL,
*addresses = NULL,
*routes = NULL,
*dhcp4_address = NULL,
*ipv4ll_address = NULL;
int r;
assert(link);
r = parse_env_file(NULL, link->state_file,
"NETWORK_FILE", &network_file,
"ADDRESSES", &addresses,
"ROUTES", &routes,
"DHCP4_ADDRESS", &dhcp4_address,
"IPV4LL_ADDRESS", &ipv4ll_address);
if (r < 0 && r != -ENOENT)
return log_link_error_errno(link, r, "Failed to read %s: %m", link->state_file);
if (network_file) {
Network *network;
char *suffix;
/* drop suffix */
suffix = strrchr(network_file, '.');
if (!suffix) {
log_link_debug(link, "Failed to get network name from %s", network_file);
goto network_file_fail;
}
*suffix = '\0';
r = network_get_by_name(link->manager, basename(network_file), &network);
if (r < 0) {
log_link_debug_errno(link, r, "Failed to get network %s: %m", basename(network_file));
goto network_file_fail;
}
r = network_apply(network, link);
if (r < 0)
return log_link_error_errno(link, r, "Failed to apply network %s: %m", basename(network_file));
}
network_file_fail:
r = link_deserialize_addresses(link, addresses);
if (r < 0)
log_link_warning_errno(link, r, "Failed to load addresses from %s, ignoring: %m", link->state_file);
r = link_deserialize_routes(link, routes);
if (r < 0)
log_link_warning_errno(link, r, "Failed to load routes from %s, ignoring: %m", link->state_file);
r = link_deserialize_dhcp4(link, dhcp4_address);
if (r < 0)
log_link_warning_errno(link, r, "Failed to load DHCPv4 address from %s, ignoring: %m", link->state_file);
r = link_deserialize_ipv4ll(link, ipv4ll_address);
if (r < 0)
log_link_warning_errno(link, r, "Failed to load IPv4LL address from %s, ignoring: %m", link->state_file);
return 0;
}
int link_add(Manager *m, sd_netlink_message *message, Link **ret) { int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
_cleanup_(sd_device_unrefp) sd_device *device = NULL; _cleanup_(sd_device_unrefp) sd_device *device = NULL;
char ifindex_str[2 + DECIMAL_STR_MAX(int)]; char ifindex_str[2 + DECIMAL_STR_MAX(int)];
@ -2497,10 +2434,6 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
log_link_debug(link, "Link %d added", link->ifindex); log_link_debug(link, "Link %d added", link->ifindex);
r = link_load(link);
if (r < 0)
return r;
if (path_is_read_only_fs("/sys") <= 0) { if (path_is_read_only_fs("/sys") <= 0) {
/* udev should be around */ /* udev should be around */
sprintf(ifindex_str, "n%d", link->ifindex); sprintf(ifindex_str, "n%d", link->ifindex);
@ -3146,18 +3079,6 @@ int link_save(Link *link) {
fputs_with_space(f, n, NULL, &space); fputs_with_space(f, n, NULL, &space);
fputc('\n', f); fputc('\n', f);
} }
/************************************************************/
r = link_serialize_addresses(link, f);
if (r < 0)
goto fail;
/************************************************************/
r = link_serialize_routes(link, f);
if (r < 0)
goto fail;
} }
print_link_hashmap(f, "CARRIER_BOUND_TO=", link->bound_to_links); print_link_hashmap(f, "CARRIER_BOUND_TO=", link->bound_to_links);
@ -3174,10 +3095,6 @@ int link_save(Link *link) {
} else } else
(void) unlink(link->lease_file); (void) unlink(link->lease_file);
r = link_serialize_ipv4ll(link, f);
if (r < 0)
goto fail;
r = link_serialize_dhcp6_client(link, f); r = link_serialize_dhcp6_client(link, f);
if (r < 0) if (r < 0)
goto fail; goto fail;

View File

@ -45,11 +45,11 @@ const sd_bus_vtable network_vtable[] = {
SD_BUS_PROPERTY("Description", "s", NULL, offsetof(Network, description), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Description", "s", NULL, offsetof(Network, description), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("SourcePath", "s", NULL, offsetof(Network, filename), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("SourcePath", "s", NULL, offsetof(Network, filename), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MatchMAC", "as", property_get_ether_addrs, offsetof(Network, match_mac), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchMAC", "as", property_get_ether_addrs, offsetof(Network, match.mac), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MatchPath", "as", NULL, offsetof(Network, match_path), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchPath", "as", NULL, offsetof(Network, match.path), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MatchDriver", "as", NULL, offsetof(Network, match_driver), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchDriver", "as", NULL, offsetof(Network, match.driver), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MatchType", "as", NULL, offsetof(Network, match_type), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchType", "as", NULL, offsetof(Network, match.iftype), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MatchName", "as", NULL, offsetof(Network, match_name), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchName", "as", NULL, offsetof(Network, match.ifname), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -5,7 +5,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#include <stddef.h> #include <stddef.h>
#include "conf-parser.h" #include "conf-parser.h"
#include "netem.h" #include "netem.h"
#include "network-internal.h" #include "net-condition.h"
#include "networkd-address-label.h" #include "networkd-address-label.h"
#include "networkd-address.h" #include "networkd-address.h"
#include "networkd-can.h" #include "networkd-can.h"
@ -41,16 +41,16 @@ struct ConfigPerfItem;
%struct-type %struct-type
%includes %includes
%% %%
Match.MACAddress, config_parse_hwaddrs, 0, offsetof(Network, match_mac) Match.MACAddress, config_parse_hwaddrs, 0, offsetof(Network, match.mac)
Match.PermanentMACAddress, config_parse_hwaddrs, 0, offsetof(Network, match_permanent_mac) Match.PermanentMACAddress, config_parse_hwaddrs, 0, offsetof(Network, match.permanent_mac)
Match.Path, config_parse_match_strv, 0, offsetof(Network, match_path) Match.Path, config_parse_match_strv, 0, offsetof(Network, match.path)
Match.Driver, config_parse_match_strv, 0, offsetof(Network, match_driver) Match.Driver, config_parse_match_strv, 0, offsetof(Network, match.driver)
Match.Type, config_parse_match_strv, 0, offsetof(Network, match_type) Match.Type, config_parse_match_strv, 0, offsetof(Network, match.iftype)
Match.WLANInterfaceType, config_parse_match_strv, 0, offsetof(Network, match_wlan_iftype) Match.WLANInterfaceType, config_parse_match_strv, 0, offsetof(Network, match.wifi_iftype)
Match.SSID, config_parse_match_strv, 0, offsetof(Network, match_ssid) Match.SSID, config_parse_match_strv, 0, offsetof(Network, match.ssid)
Match.BSSID, config_parse_hwaddrs, 0, offsetof(Network, match_bssid) Match.BSSID, config_parse_hwaddrs, 0, offsetof(Network, match.bssid)
Match.Name, config_parse_match_ifnames, IFNAME_VALID_ALTERNATIVE, offsetof(Network, match_name) Match.Name, config_parse_match_ifnames, IFNAME_VALID_ALTERNATIVE, offsetof(Network, match.ifname)
Match.Property, config_parse_match_property, 0, offsetof(Network, match_property) Match.Property, config_parse_match_property, 0, offsetof(Network, match.property)
Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(Network, conditions) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(Network, conditions)
Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(Network, conditions) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(Network, conditions)
Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(Network, conditions) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(Network, conditions)

View File

@ -12,11 +12,11 @@
#include "fd-util.h" #include "fd-util.h"
#include "hostname-util.h" #include "hostname-util.h"
#include "in-addr-util.h" #include "in-addr-util.h"
#include "networkd-dhcp-server.h" #include "net-condition.h"
#include "network-internal.h"
#include "networkd-address-label.h" #include "networkd-address-label.h"
#include "networkd-address.h" #include "networkd-address.h"
#include "networkd-dhcp-common.h" #include "networkd-dhcp-common.h"
#include "networkd-dhcp-server.h"
#include "networkd-fdb.h" #include "networkd-fdb.h"
#include "networkd-manager.h" #include "networkd-manager.h"
#include "networkd-mdb.h" #include "networkd-mdb.h"
@ -161,11 +161,7 @@ int network_verify(Network *network) {
assert(network); assert(network);
assert(network->filename); assert(network->filename);
if (set_isempty(network->match_mac) && set_isempty(network->match_permanent_mac) && if (net_match_is_empty(&network->match) && !network->conditions)
strv_isempty(network->match_path) && strv_isempty(network->match_driver) &&
strv_isempty(network->match_type) && strv_isempty(network->match_name) &&
strv_isempty(network->match_property) && strv_isempty(network->match_wlan_iftype) &&
strv_isempty(network->match_ssid) && !network->conditions)
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: No valid settings found in the [Match] section, ignoring file. " "%s: No valid settings found in the [Match] section, ignoring file. "
"To match all interfaces, add Name=* in the [Match] section.", "To match all interfaces, add Name=* in the [Match] section.",
@ -589,16 +585,7 @@ static Network *network_free(Network *network) {
free(network->filename); free(network->filename);
set_free_free(network->match_mac); net_match_clear(&network->match);
set_free_free(network->match_permanent_mac);
strv_free(network->match_path);
strv_free(network->match_driver);
strv_free(network->match_type);
strv_free(network->match_name);
strv_free(network->match_property);
strv_free(network->match_wlan_iftype);
strv_free(network->match_ssid);
set_free_free(network->match_bssid);
condition_free_list(network->conditions); condition_free_list(network->conditions);
free(network->description); free(network->description);
@ -705,13 +692,9 @@ int network_get(Manager *manager, unsigned short iftype, sd_device *device,
assert(ret); assert(ret);
ORDERED_HASHMAP_FOREACH(network, manager->networks) ORDERED_HASHMAP_FOREACH(network, manager->networks)
if (net_match_config(network->match_mac, network->match_permanent_mac, if (net_match_config(&network->match, device, mac, permanent_mac, driver, iftype,
network->match_path, network->match_driver,
network->match_type, network->match_name, network->match_property,
network->match_wlan_iftype, network->match_ssid, network->match_bssid,
device, mac, permanent_mac, driver, iftype,
ifname, alternative_names, wlan_iftype, ssid, bssid)) { ifname, alternative_names, wlan_iftype, ssid, bssid)) {
if (network->match_name && device) { if (network->match.ifname && device) {
const char *attr; const char *attr;
uint8_t name_assign_type = NET_NAME_UNKNOWN; uint8_t name_assign_type = NET_NAME_UNKNOWN;

View File

@ -10,6 +10,7 @@
#include "condition.h" #include "condition.h"
#include "conf-parser.h" #include "conf-parser.h"
#include "hashmap.h" #include "hashmap.h"
#include "net-condition.h"
#include "netdev.h" #include "netdev.h"
#include "networkd-brvlan.h" #include "networkd-brvlan.h"
#include "networkd-dhcp-common.h" #include "networkd-dhcp-common.h"
@ -65,16 +66,7 @@ struct Network {
char *description; char *description;
/* [Match] section */ /* [Match] section */
Set *match_mac; NetMatch match;
Set *match_permanent_mac;
char **match_path;
char **match_driver;
char **match_type;
char **match_name;
char **match_property;
char **match_wlan_iftype;
char **match_ssid;
Set *match_bssid;
LIST_HEAD(Condition, conditions); LIST_HEAD(Condition, conditions);
/* Master or stacked netdevs */ /* Master or stacked netdevs */

View File

@ -152,25 +152,19 @@ static const char *format_route_protocol(int protocol, char *buf, size_t size) {
static unsigned routes_max(void) { static unsigned routes_max(void) {
static thread_local unsigned cached = 0; static thread_local unsigned cached = 0;
_cleanup_free_ char *s4 = NULL, *s6 = NULL; _cleanup_free_ char *s4 = NULL, *s6 = NULL;
unsigned val4 = ROUTES_DEFAULT_MAX_PER_FAMILY, val6 = ROUTES_DEFAULT_MAX_PER_FAMILY; unsigned val4 = ROUTES_DEFAULT_MAX_PER_FAMILY, val6 = ROUTES_DEFAULT_MAX_PER_FAMILY;
if (cached > 0) if (cached > 0)
return cached; return cached;
if (sysctl_read("net/ipv4/route/max_size", &s4) >= 0) { if (sysctl_read_ip_property(AF_INET, NULL, "route/max_size", &s4) >= 0)
truncate_nl(s4); if (safe_atou(s4, &val4) >= 0 && val4 == 2147483647U)
if (safe_atou(s4, &val4) >= 0 &&
val4 == 2147483647U)
/* This is the default "no limit" value in the kernel */ /* This is the default "no limit" value in the kernel */
val4 = ROUTES_DEFAULT_MAX_PER_FAMILY; val4 = ROUTES_DEFAULT_MAX_PER_FAMILY;
}
if (sysctl_read("net/ipv6/route/max_size", &s6) >= 0) { if (sysctl_read_ip_property(AF_INET6, NULL, "route/max_size", &s6) >= 0)
truncate_nl(s6);
(void) safe_atou(s6, &val6); (void) safe_atou(s6, &val6);
}
cached = MAX(ROUTES_DEFAULT_MAX_PER_FAMILY, val4) + cached = MAX(ROUTES_DEFAULT_MAX_PER_FAMILY, val4) +
MAX(ROUTES_DEFAULT_MAX_PER_FAMILY, val6); MAX(ROUTES_DEFAULT_MAX_PER_FAMILY, val6);
@ -1597,84 +1591,6 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, Ma
return 1; return 1;
} }
int link_serialize_routes(const Link *link, FILE *f) {
bool space = false;
Route *route;
assert(link);
assert(link->network);
assert(f);
fputs("ROUTES=", f);
SET_FOREACH(route, link->routes) {
_cleanup_free_ char *route_str = NULL;
if (in_addr_to_string(route->family, &route->dst, &route_str) < 0)
continue;
fprintf(f, "%s%s/%hhu/%hhu/%"PRIu32"/%"PRIu32"/"USEC_FMT,
space ? " " : "", route_str,
route->dst_prefixlen, route->tos, route->priority, route->table, route->lifetime);
space = true;
}
fputc('\n', f);
return 0;
}
int link_deserialize_routes(Link *link, const char *routes) {
int r;
assert(link);
for (const char *p = routes;; ) {
_cleanup_(route_freep) Route *tmp = NULL;
_cleanup_free_ char *route_str = NULL;
char *prefixlen_str;
r = extract_first_word(&p, &route_str, NULL, 0);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to parse ROUTES=: %m");
if (r == 0)
return 0;
prefixlen_str = strchr(route_str, '/');
if (!prefixlen_str) {
log_link_debug(link, "Failed to parse route, ignoring: %s", route_str);
continue;
}
*prefixlen_str++ = '\0';
r = route_new(&tmp);
if (r < 0)
return log_oom();
r = sscanf(prefixlen_str,
"%hhu/%hhu/%"SCNu32"/%"PRIu32"/"USEC_FMT,
&tmp->dst_prefixlen,
&tmp->tos,
&tmp->priority,
&tmp->table,
&tmp->lifetime);
if (r != 5) {
log_link_debug(link,
"Failed to parse destination prefix length, tos, priority, table or expiration: %s",
prefixlen_str);
continue;
}
r = in_addr_from_string_auto(route_str, &tmp->family, &tmp->dst);
if (r < 0) {
log_link_debug_errno(link, r, "Failed to parse route destination %s: %m", route_str);
continue;
}
r = route_add_and_setup_timer(link, tmp, NULL, NULL);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to add route: %m");
}
}
int network_add_ipv4ll_route(Network *network) { int network_add_ipv4ll_route(Network *network) {
_cleanup_(route_free_or_set_invalidp) Route *n = NULL; _cleanup_(route_free_or_set_invalidp) Route *n = NULL;
unsigned section_line; unsigned section_line;

View File

@ -75,8 +75,6 @@ int route_remove(const Route *route, Manager *manager, Link *link, link_netlink_
int link_set_routes(Link *link); int link_set_routes(Link *link);
int link_drop_routes(Link *link); int link_drop_routes(Link *link);
int link_drop_foreign_routes(Link *link); int link_drop_foreign_routes(Link *link);
int link_serialize_routes(const Link *link, FILE *f);
int link_deserialize_routes(Link *link, const char *routes);
uint32_t link_get_dhcp_route_table(const Link *link); uint32_t link_get_dhcp_route_table(const Link *link);
uint32_t link_get_ipv6_accept_ra_route_table(const Link *link); uint32_t link_get_ipv6_accept_ra_route_table(const Link *link);

View File

@ -212,6 +212,15 @@ int link_set_sysctl(Link *link) {
if (r < 0) if (r < 0)
log_link_warning_errno(link, r, "Cannot set IPv4 accept_local flag for interface, ignoring: %m"); log_link_warning_errno(link, r, "Cannot set IPv4 accept_local flag for interface, ignoring: %m");
/* If promote_secondaries is not set, DHCP will work only as long as the IP address does not
* changes between leases. The kernel will remove all secondary IP addresses of an interface
* otherwise. The way systemd-networkd works is that the new IP of a lease is added as a
* secondary IP and when the primary one expires it relies on the kernel to promote the
* secondary IP. See also https://github.com/systemd/systemd/issues/7163 */
r = sysctl_write_ip_property_boolean(AF_INET, link->ifname, "promote_secondaries", true);
if (r < 0)
log_link_warning_errno(link, r, "Cannot enable promote_secondaries for interface, ignoring: %m");
return 0; return 0;
} }

View File

@ -1,15 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "ether-addr-util.h"
#include "hexdecoct.h" #include "hexdecoct.h"
#include "log.h" #include "log.h"
#include "macro.h" #include "macro.h"
#include "set.h" #include "net-condition.h"
#include "string-util.h"
#include "network-internal.h"
#include "networkd-conf.h" #include "networkd-conf.h"
#include "networkd-network.h" #include "networkd-network.h"
#include "strv.h"
static void test_config_parse_duid_type_one(const char *rvalue, int ret, DUIDType expected, usec_t expected_time) { static void test_config_parse_duid_type_one(const char *rvalue, int ret, DUIDType expected, usec_t expected_time) {
DUID actual = {}; DUID actual = {};
@ -174,7 +171,7 @@ static void test_config_parse_address_one(const char *rvalue, int family, unsign
assert_se(network = new0(Network, 1)); assert_se(network = new0(Network, 1));
network->n_ref = 1; network->n_ref = 1;
assert_se(network->filename = strdup("hogehoge.network")); assert_se(network->filename = strdup("hogehoge.network"));
assert_se(config_parse_match_ifnames("network", "filename", 1, "section", 1, "Name", 0, "*", &network->match_name, network) == 0); assert_se(config_parse_match_ifnames("network", "filename", 1, "section", 1, "Name", 0, "*", &network->match.ifname, network) == 0);
assert_se(config_parse_address("network", "filename", 1, "section", 1, "Address", 0, rvalue, network, network) == 0); assert_se(config_parse_address("network", "filename", 1, "section", 1, "Address", 0, rvalue, network, network) == 0);
assert_se(ordered_hashmap_size(network->addresses_by_section) == 1); assert_se(ordered_hashmap_size(network->addresses_by_section) == 1);
assert_se(network_verify(network) >= 0); assert_se(network_verify(network) >= 0);

View File

@ -8,7 +8,6 @@
#include "link.h" #include "link.h"
#include "manager.h" #include "manager.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h"
#include "strv.h" #include "strv.h"
#include "time-util.h" #include "time-util.h"
#include "util.h" #include "util.h"

View File

@ -31,6 +31,6 @@ if conf.get('ENABLE_OOMD') == 1
if install_sysconfdir if install_sysconfdir
install_data('oomd.conf', install_data('oomd.conf',
install_dir : sysconfdir) install_dir : pkgsysconfdir)
endif endif
endif endif

View File

@ -221,14 +221,6 @@ void dns_packet_rewind(DnsPacket *p, size_t idx);
int dns_packet_skip_question(DnsPacket *p); int dns_packet_skip_question(DnsPacket *p);
int dns_packet_extract(DnsPacket *p); int dns_packet_extract(DnsPacket *p);
static inline bool DNS_PACKET_SHALL_CACHE(DnsPacket *p) {
/* Never cache data originating from localhost, under the
* assumption, that it's coming from a locally DNS forwarder
* or server, that is caching on its own. */
return in_addr_is_localhost(p->family, &p->sender) == 0;
}
/* https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 */ /* https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 */
enum { enum {
DNS_RCODE_SUCCESS = 0, DNS_RCODE_SUCCESS = 0,

View File

@ -682,11 +682,9 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
if (t->scope->manager->enable_cache == DNS_CACHE_MODE_NO) if (t->scope->manager->enable_cache == DNS_CACHE_MODE_NO)
return; return;
/* We never cache if this packet is from the local host, under /* Packet from localhost? */
* the assumption that a locally running DNS server would if (!t->scope->manager->cache_from_localhost &&
* cache this anyway, and probably knows better when to flush in_addr_is_localhost(t->received->family, &t->received->sender) != 0)
* the cache then we could. */
if (!DNS_PACKET_SHALL_CACHE(t->received))
return; return;
dns_cache_put(&t->scope->cache, dns_cache_put(&t->scope->cache,

View File

@ -2,6 +2,7 @@
#pragma once #pragma once
#include "sd-event.h" #include "sd-event.h"
#include "in-addr-util.h"
typedef struct DnsTransaction DnsTransaction; typedef struct DnsTransaction DnsTransaction;
typedef enum DnsTransactionState DnsTransactionState; typedef enum DnsTransactionState DnsTransactionState;

View File

@ -30,3 +30,4 @@ Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0,
Resolve.ReadEtcHosts, config_parse_bool, 0, offsetof(Manager, read_etc_hosts) Resolve.ReadEtcHosts, config_parse_bool, 0, offsetof(Manager, read_etc_hosts)
Resolve.ResolveUnicastSingleLabel, config_parse_bool, 0, offsetof(Manager, resolve_unicast_single_label) Resolve.ResolveUnicastSingleLabel, config_parse_bool, 0, offsetof(Manager, resolve_unicast_single_label)
Resolve.DNSStubListenerExtra, config_parse_dns_stub_listener_extra, 0, offsetof(Manager, dns_extra_stub_listeners) Resolve.DNSStubListenerExtra, config_parse_dns_stub_listener_extra, 0, offsetof(Manager, dns_extra_stub_listeners)
Resolve.CacheFromLocalhost, config_parse_bool, 0, offsetof(Manager, cache_from_localhost)

View File

@ -20,7 +20,6 @@
#include "io-util.h" #include "io-util.h"
#include "missing_network.h" #include "missing_network.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h"
#include "ordered-set.h" #include "ordered-set.h"
#include "parse-util.h" #include "parse-util.h"
#include "random-util.h" #include "random-util.h"

View File

@ -39,6 +39,7 @@ struct Manager {
DnssecMode dnssec_mode; DnssecMode dnssec_mode;
DnsOverTlsMode dns_over_tls_mode; DnsOverTlsMode dns_over_tls_mode;
DnsCacheMode enable_cache; DnsCacheMode enable_cache;
bool cache_from_localhost;
DnsStubListenerMode dns_stub_listener_mode; DnsStubListenerMode dns_stub_listener_mode;
#if ENABLE_DNS_OVER_TLS #if ENABLE_DNS_OVER_TLS

View File

@ -24,6 +24,7 @@
#MulticastDNS=@DEFAULT_MDNS_MODE@ #MulticastDNS=@DEFAULT_MDNS_MODE@
#LLMNR=@DEFAULT_LLMNR_MODE@ #LLMNR=@DEFAULT_LLMNR_MODE@
#Cache=yes #Cache=yes
#CacheFromLocalhost=no
#DNSStubListener=yes #DNSStubListener=yes
#DNSStubListenerExtra= #DNSStubListenerExtra=
#ReadEtcHosts=yes #ReadEtcHosts=yes

View File

@ -11,6 +11,7 @@
#include "conf-files.h" #include "conf-files.h"
#include "conf-parser.h" #include "conf-parser.h"
#include "def.h" #include "def.h"
#include "ether-addr-util.h"
#include "extract-word.h" #include "extract-word.h"
#include "fd-util.h" #include "fd-util.h"
#include "fileio.h" #include "fileio.h"
@ -24,6 +25,7 @@
#include "process-util.h" #include "process-util.h"
#include "rlimit-util.h" #include "rlimit-util.h"
#include "sd-id128.h" #include "sd-id128.h"
#include "set.h"
#include "signal-util.h" #include "signal-util.h"
#include "socket-util.h" #include "socket-util.h"
#include "string-util.h" #include "string-util.h"
@ -251,7 +253,8 @@ static int parse_line(
} }
/* Go through the file and parse each line */ /* Go through the file and parse each line */
int config_parse(const char *unit, int config_parse(
const char *unit,
const char *filename, const char *filename,
FILE *f, FILE *f,
const char *sections, const char *sections,
@ -522,7 +525,8 @@ DEFINE_PARSER(sec, usec_t, parse_sec);
DEFINE_PARSER(sec_def_infinity, usec_t, parse_sec_def_infinity); DEFINE_PARSER(sec_def_infinity, usec_t, parse_sec_def_infinity);
DEFINE_PARSER(mode, mode_t, parse_mode); DEFINE_PARSER(mode, mode_t, parse_mode);
int config_parse_iec_size(const char* unit, int config_parse_iec_size(
const char* unit,
const char *filename, const char *filename,
unsigned line, unsigned line,
const char *section, const char *section,
@ -608,7 +612,8 @@ int config_parse_iec_uint64(
return 0; return 0;
} }
int config_parse_bool(const char* unit, int config_parse_bool(
const char* unit,
const char *filename, const char *filename,
unsigned line, unsigned line,
const char *section, const char *section,
@ -1181,7 +1186,8 @@ int config_parse_rlimit(
return 0; return 0;
} }
int config_parse_permille(const char* unit, int config_parse_permille(
const char* unit,
const char *filename, const char *filename,
unsigned line, unsigned line,
const char *section, const char *section,
@ -1212,7 +1218,8 @@ int config_parse_permille(const char* unit,
return 0; return 0;
} }
int config_parse_vlanprotocol(const char* unit, int config_parse_vlanprotocol(
const char* unit,
const char *filename, const char *filename,
unsigned line, unsigned line,
const char *section, const char *section,
@ -1222,7 +1229,9 @@ int config_parse_vlanprotocol(const char* unit,
const char *rvalue, const char *rvalue,
void *data, void *data,
void *userdata) { void *userdata) {
int *vlan_protocol = data; int *vlan_protocol = data;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
@ -1244,4 +1253,106 @@ int config_parse_vlanprotocol(const char* unit,
return 0; return 0;
} }
int config_parse_hwaddr(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
_cleanup_free_ struct ether_addr *n = NULL;
struct ether_addr **hwaddr = data;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*hwaddr = mfree(*hwaddr);
return 0;
}
n = new0(struct ether_addr, 1);
if (!n)
return log_oom();
r = ether_addr_from_string(rvalue, n);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Not a valid MAC address, ignoring assignment: %s", rvalue);
return 0;
}
free_and_replace(*hwaddr, n);
return 0;
}
int config_parse_hwaddrs(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
Set **hwaddrs = data;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
/* Empty assignment resets the list */
*hwaddrs = set_free_free(*hwaddrs);
return 0;
}
for (const char *p = rvalue;;) {
_cleanup_free_ char *word = NULL;
_cleanup_free_ struct ether_addr *n = NULL;
r = extract_first_word(&p, &word, NULL, 0);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Invalid syntax, ignoring: %s", rvalue);
return 0;
}
n = new(struct ether_addr, 1);
if (!n)
return log_oom();
r = ether_addr_from_string(word, n);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Not a valid MAC address, ignoring: %s", word);
continue;
}
r = set_ensure_put(hwaddrs, &ether_addr_hash_ops, n);
if (r < 0)
return log_oom();
if (r > 0)
TAKE_PTR(n); /* avoid cleanup */
}
}
DEFINE_CONFIG_PARSE(config_parse_percent, parse_percent, "Failed to parse percent value"); DEFINE_CONFIG_PARSE(config_parse_percent, parse_percent, "Failed to parse percent value");

View File

@ -147,6 +147,8 @@ CONFIG_PARSER_PROTOTYPE(config_parse_ip_port);
CONFIG_PARSER_PROTOTYPE(config_parse_mtu); CONFIG_PARSER_PROTOTYPE(config_parse_mtu);
CONFIG_PARSER_PROTOTYPE(config_parse_rlimit); CONFIG_PARSER_PROTOTYPE(config_parse_rlimit);
CONFIG_PARSER_PROTOTYPE(config_parse_vlanprotocol); CONFIG_PARSER_PROTOTYPE(config_parse_vlanprotocol);
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
CONFIG_PARSER_PROTOTYPE(config_parse_percent); CONFIG_PARSER_PROTOTYPE(config_parse_percent);
typedef enum Disabled { typedef enum Disabled {

View File

@ -169,6 +169,8 @@ shared_sources = files('''
module-util.h module-util.h
mount-util.c mount-util.c
mount-util.h mount-util.h
net-condition.c
net-condition.h
netif-naming-scheme.c netif-naming-scheme.c
netif-naming-scheme.h netif-naming-scheme.h
nscd-flush.c nscd-flush.c

428
src/shared/net-condition.c Normal file
View File

@ -0,0 +1,428 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <netinet/ether.h>
#include "condition.h"
#include "env-util.h"
#include "log.h"
#include "net-condition.h"
#include "network-util.h"
#include "socket-util.h"
#include "string-table.h"
#include "strv.h"
void net_match_clear(NetMatch *match) {
if (!match)
return;
match->mac = set_free_free(match->mac);
match->permanent_mac = set_free_free(match->permanent_mac);
match->path = strv_free(match->path);
match->driver = strv_free(match->driver);
match->iftype = strv_free(match->iftype);
match->ifname = strv_free(match->ifname);
match->property = strv_free(match->property);
match->wifi_iftype = strv_free(match->wifi_iftype);
match->ssid = strv_free(match->ssid);
match->bssid = set_free_free(match->bssid);
}
bool net_match_is_empty(const NetMatch *match) {
assert(match);
return
set_isempty(match->mac) &&
set_isempty(match->permanent_mac) &&
strv_isempty(match->path) &&
strv_isempty(match->driver) &&
strv_isempty(match->iftype) &&
strv_isempty(match->ifname) &&
strv_isempty(match->property) &&
strv_isempty(match->wifi_iftype) &&
strv_isempty(match->ssid) &&
set_isempty(match->bssid);
}
static bool net_condition_test_strv(char * const *patterns, const char *string) {
char * const *p;
bool match = false, has_positive_rule = false;
if (strv_isempty(patterns))
return true;
STRV_FOREACH(p, patterns) {
const char *q = *p;
bool invert;
invert = *q == '!';
q += invert;
if (!invert)
has_positive_rule = true;
if (string && fnmatch(q, string, 0) == 0) {
if (invert)
return false;
else
match = true;
}
}
return has_positive_rule ? match : true;
}
static bool net_condition_test_ifname(char * const *patterns, const char *ifname, char * const *alternative_names) {
if (net_condition_test_strv(patterns, ifname))
return true;
char * const *p;
STRV_FOREACH(p, alternative_names)
if (net_condition_test_strv(patterns, *p))
return true;
return false;
}
static int net_condition_test_property(char * const *match_property, sd_device *device) {
char * const *p;
if (strv_isempty(match_property))
return true;
STRV_FOREACH(p, match_property) {
_cleanup_free_ char *key = NULL;
const char *val, *dev_val;
bool invert, v;
invert = **p == '!';
val = strchr(*p + invert, '=');
if (!val)
return -EINVAL;
key = strndup(*p + invert, val - *p - invert);
if (!key)
return -ENOMEM;
val++;
v = device &&
sd_device_get_property_value(device, key, &dev_val) >= 0 &&
fnmatch(val, dev_val, 0) == 0;
if (invert ? v : !v)
return false;
}
return true;
}
static const char *const wifi_iftype_table[NL80211_IFTYPE_MAX+1] = {
[NL80211_IFTYPE_ADHOC] = "ad-hoc",
[NL80211_IFTYPE_STATION] = "station",
[NL80211_IFTYPE_AP] = "ap",
[NL80211_IFTYPE_AP_VLAN] = "ap-vlan",
[NL80211_IFTYPE_WDS] = "wds",
[NL80211_IFTYPE_MONITOR] = "monitor",
[NL80211_IFTYPE_MESH_POINT] = "mesh-point",
[NL80211_IFTYPE_P2P_CLIENT] = "p2p-client",
[NL80211_IFTYPE_P2P_GO] = "p2p-go",
[NL80211_IFTYPE_P2P_DEVICE] = "p2p-device",
[NL80211_IFTYPE_OCB] = "ocb",
[NL80211_IFTYPE_NAN] = "nan",
};
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(wifi_iftype, enum nl80211_iftype);
bool net_match_config(
const NetMatch *match,
sd_device *device,
const struct ether_addr *mac,
const struct ether_addr *permanent_mac,
const char *driver,
unsigned short iftype,
const char *ifname,
char * const *alternative_names,
enum nl80211_iftype wifi_iftype,
const char *ssid,
const struct ether_addr *bssid) {
_cleanup_free_ char *iftype_str;
const char *path = NULL;
assert(match);
iftype_str = link_get_type_string(device, iftype);
if (device) {
const char *mac_str;
(void) sd_device_get_property_value(device, "ID_PATH", &path);
if (!driver)
(void) sd_device_get_property_value(device, "ID_NET_DRIVER", &driver);
if (!ifname)
(void) sd_device_get_sysname(device, &ifname);
if (!mac &&
sd_device_get_sysattr_value(device, "address", &mac_str) >= 0)
mac = ether_aton(mac_str);
}
if (match->mac && (!mac || !set_contains(match->mac, mac)))
return false;
if (match->permanent_mac &&
(!permanent_mac ||
ether_addr_is_null(permanent_mac) ||
!set_contains(match->permanent_mac, permanent_mac)))
return false;
if (!net_condition_test_strv(match->path, path))
return false;
if (!net_condition_test_strv(match->driver, driver))
return false;
if (!net_condition_test_strv(match->iftype, iftype_str))
return false;
if (!net_condition_test_ifname(match->ifname, ifname, alternative_names))
return false;
if (!net_condition_test_property(match->property, device))
return false;
if (!net_condition_test_strv(match->wifi_iftype, wifi_iftype_to_string(wifi_iftype)))
return false;
if (!net_condition_test_strv(match->ssid, ssid))
return false;
if (match->bssid && (!bssid || !set_contains(match->bssid, bssid)))
return false;
return true;
}
int config_parse_net_condition(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
ConditionType cond = ltype;
Condition **list = data, *c;
bool negate;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*list = condition_free_list_type(*list, cond);
return 0;
}
negate = rvalue[0] == '!';
if (negate)
rvalue++;
c = condition_new(cond, rvalue, false, negate);
if (!c)
return log_oom();
/* Drop previous assignment. */
*list = condition_free_list_type(*list, cond);
LIST_PREPEND(conditions, *list, c);
return 0;
}
int config_parse_match_strv(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*sv = strv_free(*sv);
return 0;
}
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Invalid syntax, ignoring: %s", rvalue);
return 0;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}
int config_parse_match_ifnames(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*sv = strv_free(*sv);
return 0;
}
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, 0);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Failed to parse interface name list, ignoring: %s", rvalue);
return 0;
}
if (!ifname_valid_full(word, ltype)) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Interface name is not valid or too long, ignoring assignment: %s", word);
continue;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}
int config_parse_match_property(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *p = rvalue;
char ***sv = data;
bool invert;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
*sv = strv_free(*sv);
return 0;
}
invert = *p == '!';
p += invert;
for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNQUOTE);
if (r == 0)
return 0;
if (r == -ENOMEM)
return log_oom();
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Invalid syntax, ignoring: %s", rvalue);
return 0;
}
if (!env_assignment_is_valid(word)) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Invalid property or value, ignoring assignment: %s", word);
continue;
}
if (invert) {
k = strjoin("!", word);
if (!k)
return log_oom();
} else
k = TAKE_PTR(word);
r = strv_consume(sv, TAKE_PTR(k));
if (r < 0)
return log_oom();
}
}

View File

@ -0,0 +1,45 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <linux/nl80211.h>
#include <stdbool.h>
#include "sd-device.h"
#include "conf-parser.h"
#include "ether-addr-util.h"
#include "set.h"
typedef struct NetMatch {
Set *mac;
Set *permanent_mac;
char **path;
char **driver;
char **iftype;
char **ifname;
char **property;
char **wifi_iftype;
char **ssid;
Set *bssid;
} NetMatch;
void net_match_clear(NetMatch *match);
bool net_match_is_empty(const NetMatch *match);
bool net_match_config(
const NetMatch *match,
sd_device *device,
const struct ether_addr *mac,
const struct ether_addr *permanent_mac,
const char *driver,
unsigned short iftype,
const char *ifname,
char * const *alternative_names,
enum nl80211_iftype wifi_iftype,
const char *ssid,
const struct ether_addr *bssid);
CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
CONFIG_PARSER_PROTOTYPE(config_parse_match_strv);
CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames);
CONFIG_PARSER_PROTOTYPE(config_parse_match_property);

View File

@ -122,6 +122,7 @@ int sysctl_read_ip_property(int af, const char *ifname, const char *property, ch
if (r < 0) if (r < 0)
return r; return r;
truncate_nl(value);
if (ret) if (ret)
*ret = TAKE_PTR(value); *ret = TAKE_PTR(value);

View File

@ -126,8 +126,7 @@ tests += [
[['src/test/test-dns-domain.c'], [['src/test/test-dns-domain.c'],
[libcore, [libcore,
libshared, libshared],
libsystemd_network],
[]], []],
[['src/test/test-boot-timestamps.c'], [['src/test/test-boot-timestamps.c'],
@ -530,7 +529,6 @@ tests += [
libjournal_core, libjournal_core,
libudev_core, libudev_core,
libudev_static, libudev_static,
libsystemd_network,
libshared], libshared],
[threads, [threads,
libseccomp, libseccomp,
@ -766,7 +764,6 @@ tests += [
[['src/test/test-udev.c'], [['src/test/test-udev.c'],
[libudev_core, [libudev_core,
libudev_static, libudev_static,
libsystemd_network,
libshared], libshared],
[threads, [threads,
librt, librt,

View File

@ -206,7 +206,6 @@ fuzzers += [
'src/fuzz/fuzz.h'], 'src/fuzz/fuzz.h'],
[libudev_core, [libudev_core,
libudev_static, libudev_static,
libsystemd_network,
libshared], libshared],
[threads, [threads,
libacl]], libacl]],

View File

@ -6,7 +6,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#include "conf-parser.h" #include "conf-parser.h"
#include "ethtool-util.h" #include "ethtool-util.h"
#include "link-config.h" #include "link-config.h"
#include "network-internal.h" #include "net-condition.h"
#include "socket-util.h" #include "socket-util.h"
%} %}
struct ConfigPerfItem; struct ConfigPerfItem;
@ -20,13 +20,13 @@ struct ConfigPerfItem;
%struct-type %struct-type
%includes %includes
%% %%
Match.MACAddress, config_parse_hwaddrs, 0, offsetof(link_config, match_mac) Match.MACAddress, config_parse_hwaddrs, 0, offsetof(link_config, match.mac)
Match.PermanentMACAddress, config_parse_hwaddrs, 0, offsetof(link_config, match_permanent_mac) Match.PermanentMACAddress, config_parse_hwaddrs, 0, offsetof(link_config, match.permanent_mac)
Match.OriginalName, config_parse_match_ifnames, 0, offsetof(link_config, match_name) Match.OriginalName, config_parse_match_ifnames, 0, offsetof(link_config, match.ifname)
Match.Path, config_parse_match_strv, 0, offsetof(link_config, match_path) Match.Path, config_parse_match_strv, 0, offsetof(link_config, match.path)
Match.Driver, config_parse_match_strv, 0, offsetof(link_config, match_driver) Match.Driver, config_parse_match_strv, 0, offsetof(link_config, match.driver)
Match.Type, config_parse_match_strv, 0, offsetof(link_config, match_type) Match.Type, config_parse_match_strv, 0, offsetof(link_config, match.iftype)
Match.Property, config_parse_match_property, 0, offsetof(link_config, match_property) Match.Property, config_parse_match_property, 0, offsetof(link_config, match.property)
Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(link_config, conditions) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(link_config, conditions)
Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(link_config, conditions) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(link_config, conditions)
Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, conditions) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, conditions)

View File

@ -18,9 +18,10 @@
#include "link-config.h" #include "link-config.h"
#include "log.h" #include "log.h"
#include "memory-util.h" #include "memory-util.h"
#include "net-condition.h"
#include "netif-naming-scheme.h" #include "netif-naming-scheme.h"
#include "netlink-util.h" #include "netlink-util.h"
#include "network-internal.h" #include "network-util.h"
#include "parse-util.h" #include "parse-util.h"
#include "path-lookup.h" #include "path-lookup.h"
#include "path-util.h" #include "path-util.h"
@ -30,6 +31,7 @@
#include "string-table.h" #include "string-table.h"
#include "string-util.h" #include "string-util.h"
#include "strv.h" #include "strv.h"
#include "utf8.h"
struct link_config_ctx { struct link_config_ctx {
LIST_HEAD(link_config, links); LIST_HEAD(link_config, links);
@ -49,13 +51,7 @@ static void link_config_free(link_config *link) {
free(link->filename); free(link->filename);
set_free_free(link->match_mac); net_match_clear(&link->match);
set_free_free(link->match_permanent_mac);
strv_free(link->match_path);
strv_free(link->match_driver);
strv_free(link->match_type);
strv_free(link->match_name);
strv_free(link->match_property);
condition_free_list(link->conditions); condition_free_list(link->conditions);
free(link->description); free(link->description);
@ -167,9 +163,7 @@ int link_load_one(link_config_ctx *ctx, const char *filename) {
if (r < 0) if (r < 0)
return r; return r;
if (set_isempty(link->match_mac) && set_isempty(link->match_permanent_mac) && if (net_match_is_empty(&link->match) && !link->conditions) {
strv_isempty(link->match_path) && strv_isempty(link->match_driver) && strv_isempty(link->match_type) &&
strv_isempty(link->match_name) && strv_isempty(link->match_property) && !link->conditions) {
log_warning("%s: No valid settings found in the [Match] section, ignoring file. " log_warning("%s: No valid settings found in the [Match] section, ignoring file. "
"To match all interfaces, add OriginalName=* in the [Match] section.", "To match all interfaces, add OriginalName=* in the [Match] section.",
filename); filename);
@ -279,11 +273,8 @@ int link_config_get(link_config_ctx *ctx, sd_device *device, link_config **ret)
(void) link_unsigned_attribute(device, "name_assign_type", &name_assign_type); (void) link_unsigned_attribute(device, "name_assign_type", &name_assign_type);
LIST_FOREACH(links, link, ctx->links) { LIST_FOREACH(links, link, ctx->links) {
if (net_match_config(link->match_mac, link->match_permanent_mac, link->match_path, link->match_driver, if (net_match_config(&link->match, device, NULL, &permanent_mac, NULL, iftype, NULL, NULL, 0, NULL, NULL)) {
link->match_type, link->match_name, link->match_property, NULL, NULL, NULL, if (link->match.ifname && !strv_contains(link->match.ifname, "*") && name_assign_type == NET_NAME_ENUM)
device, NULL, &permanent_mac, NULL, iftype, NULL, NULL, 0, NULL, NULL)) {
if (link->match_name && !strv_contains(link->match_name, "*") && name_assign_type == NET_NAME_ENUM)
log_device_warning(device, "Config file %s is applied to device based on potentially unpredictable interface name.", log_device_warning(device, "Config file %s is applied to device based on potentially unpredictable interface name.",
link->filename); link->filename);
else else
@ -668,6 +659,48 @@ int link_get_driver(link_config_ctx *ctx, sd_device *device, char **ret) {
return 0; return 0;
} }
int config_parse_ifalias(
const char *unit,
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
char **s = data;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
if (!isempty(rvalue)) {
*s = mfree(*s);
return 0;
}
if (!ascii_is_valid(rvalue)) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Interface alias is not ASCII clean, ignoring assignment: %s", rvalue);
return 0;
}
if (strlen(rvalue) >= IFALIASZ) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Interface alias is too long, ignoring assignment: %s", rvalue);
return 0;
}
if (free_and_strdup(s, rvalue) < 0)
return log_oom();
return 0;
}
static const char* const mac_address_policy_table[_MAC_ADDRESS_POLICY_MAX] = { static const char* const mac_address_policy_table[_MAC_ADDRESS_POLICY_MAX] = {
[MAC_ADDRESS_POLICY_PERSISTENT] = "persistent", [MAC_ADDRESS_POLICY_PERSISTENT] = "persistent",
[MAC_ADDRESS_POLICY_RANDOM] = "random", [MAC_ADDRESS_POLICY_RANDOM] = "random",

View File

@ -7,7 +7,7 @@
#include "conf-parser.h" #include "conf-parser.h"
#include "ethtool-util.h" #include "ethtool-util.h"
#include "list.h" #include "list.h"
#include "set.h" #include "net-condition.h"
typedef struct link_config_ctx link_config_ctx; typedef struct link_config_ctx link_config_ctx;
typedef struct link_config link_config; typedef struct link_config link_config;
@ -35,13 +35,7 @@ typedef enum NamePolicy {
struct link_config { struct link_config {
char *filename; char *filename;
Set *match_mac; NetMatch match;
Set *match_permanent_mac;
char **match_path;
char **match_driver;
char **match_type;
char **match_name;
char **match_property;
LIST_HEAD(Condition, conditions); LIST_HEAD(Condition, conditions);
char *description; char *description;
@ -93,6 +87,7 @@ MACAddressPolicy mac_address_policy_from_string(const char *p) _pure_;
/* gperf lookup function */ /* gperf lookup function */
const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length); const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
CONFIG_PARSER_PROTOTYPE(config_parse_mac_address_policy); CONFIG_PARSER_PROTOTYPE(config_parse_mac_address_policy);
CONFIG_PARSER_PROTOTYPE(config_parse_name_policy); CONFIG_PARSER_PROTOTYPE(config_parse_name_policy);
CONFIG_PARSER_PROTOTYPE(config_parse_alternative_names_policy); CONFIG_PARSER_PROTOTYPE(config_parse_alternative_names_policy);

View File

@ -374,6 +374,7 @@ Bond=
Bridge= Bridge=
Broadcast= Broadcast=
Cache= Cache=
CacheFromLocalhost=
ClientIdentifier= ClientIdentifier=
ConfigureWithoutCarrier= ConfigureWithoutCarrier=
CopyDSCP= CopyDSCP=

View File

@ -2891,7 +2891,6 @@ class NetworkdStateFileTests(unittest.TestCase, Utilities):
self.assertRegex(data, r'LLMNR=no') self.assertRegex(data, r'LLMNR=no')
self.assertRegex(data, r'MDNS=yes') self.assertRegex(data, r'MDNS=yes')
self.assertRegex(data, r'DNSSEC=no') self.assertRegex(data, r'DNSSEC=no')
self.assertRegex(data, r'ADDRESSES=192.168.(10.10|12.12)/24 192.168.(12.12|10.10)/24')
check_output(*resolvectl_cmd, 'dns', 'dummy98', '10.10.10.12#ccc.com', '10.10.10.13', '1111:2222::3333', env=env) check_output(*resolvectl_cmd, 'dns', 'dummy98', '10.10.10.12#ccc.com', '10.10.10.13', '1111:2222::3333', env=env)
check_output(*resolvectl_cmd, 'domain', 'dummy98', 'hogehogehoge', '~foofoofoo', env=env) check_output(*resolvectl_cmd, 'domain', 'dummy98', 'hogehogehoge', '~foofoofoo', env=env)

View File

@ -134,6 +134,8 @@ USB_IDS += [
'12d1:15bb', '12d1:15bb',
# Fibocom (L850-GL) (coral, nautilus, sarien) # Fibocom (L850-GL) (coral, nautilus, sarien)
'2cb7:0007', '2cb7:0007',
# Fibocom (NL668, NL652)
'2cb7:01a0',
] ]
# Mass Storage # Mass Storage