Commit Graph

1595 Commits

Author SHA1 Message Date
Yu Watanabe 29f69c5741 test-network: add test for IPv4AcceptLocal= 2020-06-08 13:51:50 +09:00
Yu Watanabe 94d76d071e network: introduce IPv4AcceptLocal= setting
Closes #16090.
2020-06-08 13:48:17 +09:00
Frantisek Sumsal 7887e58051 test: avoid failing due to unexpected precision
After today's Arch Linux image update, there seems to be a slight change
in delay reporting which breaks some asserts in
systemd-networkd-tests.py:

Expected:
        limit 100 delay 50.0ms  10.0ms loss 20%
Current:
        limit 100 delay 50ms  10ms loss 20%
2020-06-06 18:33:35 +02:00
Zbigniew Jędrzejewski-Szmek ea9f36ac83
Merge pull request #15378 from msekletar/udev-kill-signal
udev:  make signal that we use to kill workers on timeout configurable
2020-06-05 16:33:14 +02:00
Michal Sekletár 3611ed7378 test: add integration test for udev event timeout
Note that run_test() calls coredumpctl in a loop because in certain
environments (1 vCPU unaccelerated QEMU VM) it might take quite a
while to process the coredump.
2020-06-05 11:09:21 +02:00
Yu Watanabe 891ff9633f test-network: add tests for QFQ 2020-06-03 17:25:48 +09:00
Yu Watanabe 4d7ddaf97b network: tc: introduce [QuickFairQueueingClass] section 2020-06-03 17:25:44 +09:00
Susant Sahani b12aaee5ab network: tc: introduce Quick Fair Queueing (QFQ) 2020-06-03 14:17:51 +09:00
Lennart Poettering 7183b22f12
Merge pull request #15996 from yuwata/network-dhcp6-route-metric-15295
network: add RouteMetric= in [DHCPv6] section
2020-06-02 19:29:47 +02:00
Luca Boccassi 68f6c58354 test: temporarily block test 48 on Ubuntu's autopkgtest
This test runs fine locally (both on Qemu and nspawn) but sporadically fails on
autopkgtest for some reason.
Disable it while the issue is investigated to reduce noise.
2020-06-02 11:35:23 +02:00
Yu Watanabe 1bf1bfd958 network: add DHCPv6.RouteMetric=
Hopefully fixes #15295.
2020-06-02 15:16:51 +09:00
Yu Watanabe 0e77fc66bc network: fix double free in macsec_receive_channel_free()
Fixes #15941.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22547
2020-06-01 09:39:46 +02:00
Yu Watanabe da3509f0f5 test-network: add test for wireguard without peers 2020-06-01 14:23:03 +09:00
Yu Watanabe f3e4b1e07c
Merge pull request #15884 from ssahani/dhcpv6-vendor
DHCPv6: Introduce vendor specific
2020-06-01 12:25:54 +09:00
Evgeny Vereshchagin fdd156dd99 tests: add a testcase triggering https://github.com/systemd/systemd/issues/15968
It's just a follow-up to https://github.com/systemd/systemd/pull/15976
2020-05-31 21:39:37 +02:00
Luca Boccassi d904afc730 core: reload cache if it's dirty when starting a UNIT_NOT_FOUND unit
The time-based cache allows starting a new unit without an expensive
daemon-reload, unless there was already a reference to it because of
a dependency or ordering from another unit.
If the cache is out of date, check again if we can load the
fragment.
2020-05-30 16:50:05 +02:00
Jay Burger eed44b715d fix_test_function_timeout 2020-05-30 12:01:29 +02:00
Yu Watanabe 433e14fda7 network: fix memleaks
Fixes #15951.
2020-05-29 14:49:40 +02:00
Susant Sahani b4ccc5de7d network: Inroduce DHCP6- send vendor options
network: Inroduce DHCP6- send vendor options

```
 0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      OPTION_VENDOR_OPTS       |           option-len          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       enterprise-number                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                       vendor-option-data                      .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
```

```
  0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          sub-opt-code         |         sub-option-len        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                        sub-option-data                        .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 31: Vendor-specific Options Format

      sub-opt-code         The code for the sub-option.  A 2-octet
                           field.

      sub-option-len       An unsigned integer giving the length of the
                           sub-option-data field in this sub-option in
                           octets.  A 2-octet field.

      sub-option-data      The data area for the sub-option.  The
                           length, in octets, is specified by
                           sub-option-len.

```
2020-05-29 13:37:57 +02:00
Susant Sahani 9efa8a3cff network: DHCPv6 Assign delegated prefix to LAN interface
In DHCPv6-PD environment, where WAN interface requests IPv6 via DHCPv6,
receives the address as well as delegated prefixes, with LAN interfaces
serving those delegated prefixes in their router advertisement messages.
The LAN interfaces on the router themselves do not have
the IPv6 addresses assigned by networkd from the prefix it
serves on that interface. Now this patch enables it.
2020-05-29 16:20:37 +09:00
Yu Watanabe 27cd09442f
Merge pull request #15942 from poettering/pass-pktinfo
disable PassCredentials= on networkd netlink socket, enable NETLINK_PKTINFO instead
2020-05-29 15:23:15 +09:00
Yu Watanabe 63b00fa77d
Merge pull request #15619 from ddstreet/ignore_carrier_loss_default
Set IgnoreCarrierLoss= default to value of ConfigureWithoutCarrier=
2020-05-29 10:04:00 +09:00
Lennart Poettering a3d19f5d99 core: add new PassPacketInfo= socket unit property 2020-05-27 22:40:38 +02:00
Lennart Poettering bb2294e454
Merge pull request #15669 from andir/systemd-ipv6-pd-subnet-id
networkd: subnet id support for ipv6 prefix delegation
2020-05-27 18:47:26 +02:00
Lennart Poettering 6bce17455e
Merge pull request #15226 from benzea/benzea/xdg-autostart-generator
xdg-autostart-generator: a generator for XDG autostart files
2020-05-27 18:41:01 +02:00
Frantisek Sumsal ffbb0fb9cb meson: support building fuzzers with meson <0.48.0 2020-05-27 12:27:45 +02:00
Benjamin Berg 2ad7597e44 fuzz: Add an XDG desktop file fuzzer
To test the XDG parser used by the xdg-autostart-generator.

Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-05-27 09:02:10 +02:00
Frantisek Sumsal 2991fa41e4 test: create public images by default
Let's create new images public by default and then symlink/copy them
into the respective private directories afterwards, not the other way
around. This should fix a nasty race condition in parallel runs where
one tests attempts to copy the backing public image at the same moment
another test is already modifying it.
2020-05-27 08:41:02 +02:00
Frantisek Sumsal 8441ff6886 test: make the systemd-run calls synchronous
Otherwise we might be checking results of such calls before they even
finish, causing nasty races like:

```
[   15.656530] testsuite-43.sh[303]: + su testuser -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID exec "$@"' -- sh systemd-run --user --unit=test-unprotected-home -P touch /home/testuser/works.txt
...
[   15.757744] testsuite-43.sh[324]: Running as unit: test-unprotected-home.service
[   15.775611] systemd[296]: Started /usr/bin/touch /home/testuser/works.txt.
[   15.783597] testsuite-43.sh[303]: + test -e /home/testuser/works.txt
[   15.787542] systemd[296]: test-unprotected-home.service: Succeeded.
...
[   15.787684] systemd[1]: Received SIGCHLD from PID 303 (bash).
[   15.787790] systemd[1]: Child 303 (bash) died (code=exited, status=1/FAILURE)
[   15.787881] systemd[1]: testsuite-43.service: Child 303 belongs to testsuite-43.service.
[   15.788040] systemd[1]: testsuite-43.service: Main process exited, code=exited, status=1/FAILURE
[   15.788224] systemd[1]: testsuite-43.service: Failed with result 'exit-code'.
[   15.788333] systemd[1]: testsuite-43.service: Service will not restart (restart setting)
[   15.788421] systemd[1]: testsuite-43.service: Changed start -> failed
[   15.788790] systemd[1]: testsuite-43.service: Job 160 testsuite-43.service/start finished, result=failed
[   15.788995] systemd[1]: Failed to start testsuite-43.service.
```
2020-05-27 08:36:57 +02:00
Dan Streetman 0fc0d85fae test: add bridge configure-without-carrier test
Verify configure-without-carrier works, and retains configuration
across carrier losses/gains.
2020-05-26 09:52:55 -04:00
Dan Streetman 9bacf4313e test: expand configure-without-carrier test
The test currently doesn't actually test configure-without-carrier since
it does have carrier for the entire test.  It now forces carrier down
before starting the network portion of the test. Also, it tests to verify
the configuration is retained across future carrier losses/gains.
2020-05-26 09:52:55 -04:00
Andreas Rammhold 02e9e34bd9
networkd: Add support for setting a preferred subnet id for IPv6 PD leases
This allows users to configure a subnet id that should be used instead
of automatically (sequentially) assigned subnets. The previous attempt
had the downside that the subnet id would not be the same between
networkd restarts. In some setups it is desirable to have predictable
subnet ids across restarts of services and systems.

The code for the assignment had to be broken up into two pieces. One of
them is the old (sequential) assignment of prefixes and the other is the
new assignment based on configured subnet ids. The new assignment code
has to be executed first and has to be taken into account when (later
on) allocating the "old" subnets from the same pool.

Instead of having one iteration through the links we are now trying to
allocate a prefix for every link on every delegated prefix, unless they
received an assignment in a previous iteration.
2020-05-26 12:41:22 +02:00
Evgeny Vereshchagin e5af586f49 add a test triggering https://github.com/systemd/systemd/issues/15907 2020-05-26 09:01:26 +02:00
Lennart Poettering 1283366a90
Merge pull request #15167 from ssahani/address-gen-mode
networkctl: Add a range to address genmode
2020-05-25 17:32:00 +02:00
Topi Miettinen cc1c85fbc3 login: limit nr_inodes for /run/user/$UID
Limit number of inodes for tmpfs mounts on /run/user/$UID. Default is
RuntimeDirectorySize= divided by 4096.
2020-05-24 22:54:17 +02:00
Evgeny Vereshchagin 3c60fb077f
Merge pull request #15886 from mrc0mmand/travis-enable-fuzz-tests
travis: enable fuzzer regression tests under sanitizers
2020-05-23 19:21:44 +03:00
Frantisek Sumsal 87666b31f9 meson: pass the optimization level to the fuzzer build 2020-05-23 14:19:25 +02:00
Evgeny Vereshchagin 0d5266541c tests: add a testcase for https://github.com/systemd/systemd/issues/15885 2020-05-22 13:35:00 +02:00
Zbigniew Jędrzejewski-Szmek 766507972b
Merge pull request #15433 from mrc0mmand/test-reintroduce-parallelization
test: copy the test image instead of symlinking it
2020-05-21 17:56:33 +02:00
Susant Sahani a6f1848a23 network: Allow to configure addr_gen_mode
Defines how link-local and autoconf addresses are generated.

	0: generate address based on EUI64 (default)
	1: do no generate a link-local address, use EUI64 for addresses generated
	   from autoconf
	2: generate stable privacy addresses, using the secret from
	   stable_secret (RFC7217)
	3: generate stable privacy addresses, using a random secret if unset
2020-05-21 14:41:04 +02:00
Evgeny Vereshchagin a88dce2bdd
Merge pull request #15865 from evverx/ubsan-to-the-rescue
build-system: build the fuzz targets with both ASan and UBSan
2020-05-21 03:17:20 +03:00
Zbigniew Jędrzejewski-Szmek 929d07ddcb
Merge pull request #15274 from ssahani/network-issue-9610
DHCP4: Allow lease time to be set when missing from offer
2020-05-20 16:39:41 +02:00
Lennart Poettering 400530c1e2
Merge pull request #15490 from ssahani/dhcpv6-vendor-class
network: DHCPv6 - Add support to send vendor class information
2020-05-20 16:18:18 +02:00
Evgeny Vereshchagin 8976715804 build-system: build the fuzz targets with both ASan and UBSan
Just a follow-up to https://github.com/systemd/systemd/pull/15860
2020-05-20 16:07:13 +02:00
Zbigniew Jędrzejewski-Szmek a94d11cc66
Merge pull request #15860 from keszybz/bus-message-empty-fields
Fix crash on message with empty fields structure
2020-05-20 15:53:28 +02:00
Zbigniew Jędrzejewski-Szmek bb94ded693
Merge pull request #15661 from hundeboll/mount-read-write-only
Mount read write only
2020-05-20 15:48:04 +02:00
Zbigniew Jędrzejewski-Szmek e0c17a7d1b bus-message: fix negative offset with ~empty message
In the linked reproducer, m->fields_size == 0, and we calculate ri == -1, which
of course doesn't end well. Skip the whole calculation if m->fields_size == 0,
and also check that we don't go negative even if it is non-zero.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19446 and #15583.
2020-05-20 09:33:54 +02:00
Susant Sahani ed0d1b2e99 network: DHCPv6 - Add support to send vendor class information
Frame 1: 177 bytes on wire (1416 bits), 177 bytes captured (1416 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x5ca46b
    Rapid Commit
    Identity Association for Non-temporary Address
    Fully Qualified Domain Name
    Vendor Class
        Option: Vendor Class (16)
        Length: 23
        Value: 0000ab11000048656c6c6f3a686f773a6172653a796f75
        Enterprise ID: Tom Gundersen (systemd) (43793)
        vendor-class-data: Hello:how:are:you
    Identity Association for Prefix Delegation
    Option Request
    Client Identifier
    Elapsed time
2020-05-20 07:58:03 +02:00
Susant Sahani d6463307e0 network: DHCPv4- Allow to set DHCP lease lifetime 2020-05-20 06:32:26 +02:00
Susant Sahani f37f2a6b8a network: DHCPv6 - Add support to send user class
Frame 115: 171 bytes on wire (1368 bits), 171 bytes captured (1368 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x673257
    Rapid Commit
        Option: Rapid Commit (14)
        Length: 0
    Identity Association for Non-temporary Address
        Option: Identity Association for Non-temporary Address (3)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Fully Qualified Domain Name
        Option: Fully Qualified Domain Name (39)
        Length: 6
        Value: 01045a657573
        0000 0... = Reserved: 0x00
        .... .0.. = N bit: Server should perform DNS updates
        .... ..0. = O bit: Server has not overridden client's S bit preference
        .... ...1 = S bit: Server should perform forward DNS updates
        Client FQDN: Zeus
    User Class
        Option: User Class (15)
        Length: 17
        Value: 000f68656c6c6f30313233343031323334
    Identity Association for Prefix Delegation
        Option: Identity Association for Prefix Delegation (25)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Option Request
        Option: Option Request (6)
        Length: 10
        Value: 001700180038001f000e
        Requested Option code: DNS recursive name server (23)
        Requested Option code: Domain Search List (24)
        Requested Option code: NTP Server (56)
        Requested Option code: Simple Network Time Protocol Server (31)
        Requested Option code: Rapid Commit (14)
    Client Identifier
        Option: Client Identifier (1)
        Length: 14
        Value: 00020000ab11d258482fc7eee651
        DUID: 00020000ab11d258482fc7eee651
        DUID Type: assigned by vendor based on Enterprise number (2)
        Enterprise ID: Tom Gundersen (systemd) (43793)
        Identifier: d258482fc7eee651
    Elapsed time
        Option: Elapsed time (8)
        Length: 2
        Value: 0bd0
        Elapsed time: 30240ms
2020-05-19 11:48:30 +02:00