]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agotests: hook up the repository to Azure Pipelines 12524/head
Evgeny Vereshchagin [Sun, 12 May 2019 02:04:29 +0000 (04:04 +0200)] 
tests: hook up the repository to Azure Pipelines

The idea is to move a couple of stages from Travis CI (which has been
overloaded since I added the "FuzzBuzz" stage) to Azure Pipelines.

4 years agotravis: make the ASan+UBSan stage compatible with Azure Pipelines
Evgeny Vereshchagin [Sun, 12 May 2019 01:45:29 +0000 (03:45 +0200)] 
travis: make the ASan+UBSan stage compatible with Azure Pipelines

4 years agotests: override a hard-coded timeout that kicks in too early (under ASan+UBSan)
Evgeny Vereshchagin [Fri, 10 May 2019 16:33:35 +0000 (18:33 +0200)] 
tests: override a hard-coded timeout that kicks in too early (under ASan+UBSan)

The test has failed two times today: https://travis-ci.org/systemd/systemd/jobs/530750626
and https://travis-ci.org/systemd/systemd/jobs/530759465.

4 years agotests: redirect the stdout/stderr of journald to a file (under ASan+UBSan)
Evgeny Vereshchagin [Fri, 10 May 2019 00:47:03 +0000 (02:47 +0200)] 
tests: redirect the stdout/stderr of journald to a file (under ASan+UBSan)

Sometimes UBSan sends its reports to stderr regardless of what is specified in log_path
Let's try to catch them by redirecting stderr (and stdout just in case) to a file
See https://github.com/systemd/systemd/pull/12524#issuecomment-491108821

4 years agotests: redirect UBsan reports to a file
Evgeny Vereshchagin [Thu, 9 May 2019 23:00:29 +0000 (01:00 +0200)] 
tests: redirect UBsan reports to a file

so that they won't end up in /dev/null

4 years agoMerge pull request #12521 from mrc0mmand/test-functions-tweaks-for-sanitizers
Evgeny Vereshchagin [Fri, 10 May 2019 14:17:23 +0000 (17:17 +0300)] 
Merge pull request #12521 from mrc0mmand/test-functions-tweaks-for-sanitizers

test: don't preload libasan for systemd-remount-fs.service

4 years agoMerge pull request #12480 from ssahani/proxy-arp
Yu Watanabe [Fri, 10 May 2019 13:30:41 +0000 (15:30 +0200)] 
Merge pull request #12480 from ssahani/proxy-arp

network: bridge add support to configure proxy ARP/WIFI

4 years agonetworkd: Add support for blacklisting servers
Susant Sahani [Tue, 30 Apr 2019 22:47:41 +0000 (04:17 +0530)] 
networkd: Add support for blacklisting servers

closes #6260

fuzzer: Add DHCP support for blacklisting servers

4 years agoMerge pull request #12230 from poettering/varlink-minimal
Zbigniew Jędrzejewski-Szmek [Fri, 10 May 2019 07:40:49 +0000 (09:40 +0200)] 
Merge pull request #12230 from poettering/varlink-minimal

add simple varlink implementation + allow to move journald logging back from /var to /run

4 years agonetworkd: Log error if LLDP fails to start/stop
Susant Sahani [Thu, 9 May 2019 18:24:29 +0000 (23:54 +0530)] 
networkd: Log error if LLDP fails to start/stop

Now LLDP does not log anything why it failed which
is hard to debug. Let's just add some logs.

https://github.com/systemd/systemd/issues/10881

4 years agopo: minor fixes to Italian translation (#12500)
Daniele Medri [Thu, 9 May 2019 18:50:18 +0000 (20:50 +0200)] 
po: minor fixes to Italian translation (#12500)

4 years agoupdate TODO 12230/head
Lennart Poettering [Fri, 12 Apr 2019 12:13:17 +0000 (14:13 +0200)] 
update TODO

4 years agoman: document the two new journalctl commands
Lennart Poettering [Fri, 5 Apr 2019 16:59:25 +0000 (18:59 +0200)] 
man: document the two new journalctl commands

4 years agounits: automatically revert to /run logging on shutdown if necessary
Lennart Poettering [Fri, 5 Apr 2019 16:22:31 +0000 (18:22 +0200)] 
units: automatically revert to /run logging on shutdown if necessary

Fixes: #867
4 years agojournalctl: add new --relinquish and --smart-relinquish options
Lennart Poettering [Fri, 5 Apr 2019 16:21:02 +0000 (18:21 +0200)] 
journalctl: add new --relinquish and --smart-relinquish options

The latter is identical to the former, but becomes a NOP if
/var/log/journal is on the same mount as /, and thus during shutdown
unmounting /var is not necessary and hence we can keep logging until the
very end.

4 years agojournald: add API to move logging from /var to /run again
Lennart Poettering [Fri, 5 Apr 2019 16:20:25 +0000 (18:20 +0200)] 
journald: add API to move logging from /var to /run again

We now have this nice little Varlink API, let's beef it up a bit.

4 years agojournalctl: port --flush/--sync/--rotate to use varlink method calls
Lennart Poettering [Thu, 4 Apr 2019 17:41:33 +0000 (19:41 +0200)] 
journalctl: port --flush/--sync/--rotate to use varlink method calls

4 years agojournald: also offer flush/rotate/sync as varlink method calls
Lennart Poettering [Thu, 4 Apr 2019 17:38:18 +0000 (19:38 +0200)] 
journald: also offer flush/rotate/sync as varlink method calls

This makes the operations previously available via asynchronous signals
also available as regular varlink method calls, i.e. with sane
completion.

4 years agofuzzer: add varlink fuzzer
Lennart Poettering [Thu, 11 Apr 2019 16:42:37 +0000 (18:42 +0200)] 
fuzzer: add varlink fuzzer

4 years agotests: add varlink test
Lennart Poettering [Thu, 11 Apr 2019 16:47:10 +0000 (18:47 +0200)] 
tests: add varlink test

4 years agoshared: add minimal varlink implementation
Lennart Poettering [Thu, 11 Apr 2019 16:46:54 +0000 (18:46 +0200)] 
shared: add minimal varlink implementation

This adds a minimal Varlink (https://varlink.org/) implementation to our
tree. Given that we already have a JSON logic it's an easy thing to add.

Why bother?

We currently have major problems with IPC before dbus-daemon is up, and
in all components that dbus-daemon itself makes use of (such as various
NSS modules to resolve users as well as the journal which dbus-daemon
logs to). Because of that we so far ended up creating various (usually
crappy) work-arounds either coming up with secondary IPC systems or
sharing data statelessly in /run or similar. Let's clean this up, and
instead use a clean, well-defined, broker-less IPC for cases like that.

This is a minimal implementation of Varlink, i.e. the most basic logic
only. Stuff that's missing is left out on purpose: there's no
introspection/validation and there's no name service. It might make
sense to add that later, but for now let's only do the minimum buy-in we
can get away with. In particular as I'd assume that at least initially
we only use this IPC for our internal communication avoiding
introspection and the name service should be fine.

Specifically, I'd expect that we add IPC interfaces to the following
concepts with this scheme:

1. nss-resolve (so that hostname lookups with resolved work before
   resolved is up)
2. journald (so that IPC calls to journald don't have to go through
   dbus-daemon thus creating a cyclic dependency between journald and
   dbus-daemon)
3. nss-systemd (so that dynamic user lookups via PID 1 work sanely even
   inside of dbus-daemon, because otherwise we'd want to use dbus to run
   dbus which causes deadlocks)
4. networkd (to make sure one can talk to it in the initrd already,
   long before dbus is around)

And there might be other cases similar to this.

4 years agotest: allow SKIP_INITRD override 12521/head
Frantisek Sumsal [Thu, 9 May 2019 17:30:13 +0000 (19:30 +0200)] 
test: allow SKIP_INITRD override

Certain distributions (e.g. Arch Linux) require booting with initrd, as
they lack support for commonly used filesystems in the kernel (i.e. the
support is compiled in as modules)

4 years agotest: don't preload libasan for systemd-remount-fs.service
Frantisek Sumsal [Thu, 9 May 2019 17:20:34 +0000 (19:20 +0200)] 
test: don't preload libasan for systemd-remount-fs.service

The `mount` utility has an unexpected behavior when run with libasan,
causing false-positives during the integration testing.

For example, on Arch Linux with LD_PRELOAD pointing to libasan:
```
bash-5.0# mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
1
```
However:
```
bash-5.0# LD_PRELOAD= mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
0
```
Further investigation with strace shows a LeakSanitizer error:
```
bash-5.0# strace -s 512 mount -o remount,rw -v /
...
write(2, "==355==LeakSanitizer has encountered a fatal error.\n", 52) = -1 EBADF (Bad file descriptor)
write(2, "ReportFile::Write() can't output requested buffer!\n", 51) = -1 EBADF (Bad file descriptor)
exit_group(1)                           = ?
+++ exited with 1 +++
```

Let's workaround this by clearing the LD_PRELOAD variable for
systemd-remount-fs.service

4 years agoMerge pull request #12513 from ssahani/vxlan
Yu Watanabe [Thu, 9 May 2019 09:26:43 +0000 (11:26 +0200)] 
Merge pull request #12513 from ssahani/vxlan

networkd: Allow users to set the IPv4 DF bit in outgoing packets

4 years agonetwork: add support to configure proxy ARP/WIFI 12480/head
Susant Sahani [Thu, 9 May 2019 00:32:12 +0000 (02:32 +0200)] 
network: add support to configure proxy ARP/WIFI

4 years agonetworkd: VXLAN add support to configure IP Don't fragment. 12513/head
Susant Sahani [Wed, 8 May 2019 17:01:08 +0000 (22:31 +0530)] 
networkd: VXLAN add support to configure IP Don't fragment.

Allow users to set the IPv4 DF bit in outgoing packets, or to inherit its
value from the IPv4 inner header. If the encapsulated protocol is IPv6 and
DF is configured to be inherited, always set it.

4 years agosd-netlink: Add VXLAN netlink properties
Susant Sahani [Wed, 8 May 2019 16:59:40 +0000 (22:29 +0530)] 
sd-netlink: Add VXLAN netlink properties

Add IFLA_VXLAN_DF and IFLA_VXLAN_TTL_INHERIT

4 years agonetworkd: Assign VXLAN destination port to when GPE is set
Susant Sahani [Wed, 8 May 2019 14:39:42 +0000 (20:09 +0530)] 
networkd: Assign VXLAN destination port to when GPE is set

When VXLAN destination port is unset and GPE is set
then assign 4790 to destination port. Kernel does the same as
well as iproute.

IANA VXLAN-GPE port is 4790

4 years agonetworkd: fix link_up() (#12505)
Susant Sahani [Thu, 9 May 2019 02:05:35 +0000 (07:35 +0530)] 
networkd: fix link_up() (#12505)

Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes #12504.

4 years agonetwork: include glibc headers before including kernel headers
Yu Watanabe [Thu, 9 May 2019 00:33:45 +0000 (02:33 +0200)] 
network: include glibc headers before including kernel headers

4 years agonetwork: drop arpa/inet.h from networkd-manager.h
Yu Watanabe [Thu, 9 May 2019 00:33:33 +0000 (02:33 +0200)] 
network: drop arpa/inet.h from networkd-manager.h

4 years agosd-netlink: include glibc headers earlier to resolve conflict with kernel headers
Yu Watanabe [Thu, 9 May 2019 00:27:24 +0000 (02:27 +0200)] 
sd-netlink: include glibc headers earlier to resolve conflict with kernel headers

Then, hopefully libc-compat.h make everything fine.

4 years agonetwork: replace inet_pton() with in_addr_from_string()
Yu Watanabe [Wed, 8 May 2019 22:14:06 +0000 (00:14 +0200)] 
network: replace inet_pton() with in_addr_from_string()

4 years agonetwork: replace inet_ntop() with in_addr_to_string()
Yu Watanabe [Wed, 8 May 2019 22:03:54 +0000 (00:03 +0200)] 
network: replace inet_ntop() with in_addr_to_string()

4 years agonetworkd: Add support to configure proxy ARP and proxy ARP Wifi
Susant Sahani [Sat, 4 May 2019 14:51:13 +0000 (20:21 +0530)] 
networkd: Add support to configure proxy ARP and proxy ARP Wifi

4 years agoMerge pull request #12445 from cdown/dmm_docs
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 16:09:45 +0000 (18:09 +0200)] 
Merge pull request #12445 from cdown/dmm_docs

cgroup: Some memory protection fixes

4 years agoMerge pull request #12411 from keszybz/pr/12394
Lennart Poettering [Wed, 8 May 2019 14:11:32 +0000 (10:11 -0400)] 
Merge pull request #12411 from keszybz/pr/12394

run: when emitting the calendarspec warning, use red

4 years agoMerge pull request #12509 from poettering/table-fixlets
Lennart Poettering [Wed, 8 May 2019 14:10:55 +0000 (10:10 -0400)] 
Merge pull request #12509 from poettering/table-fixlets

two trivial fixes to table formatting code

4 years agoutil-lib: fix a typo in rdrand
Evgeny Vereshchagin [Wed, 8 May 2019 13:50:53 +0000 (15:50 +0200)] 
util-lib: fix a typo in rdrand

Otherwise, the fuzzers will fail to compile with MSan:
```
../../src/systemd/src/basic/random-util.c:64:40: error: use of undeclared identifier 'sucess'; did you mean 'success'?
        msan_unpoison(&success, sizeof(sucess));
                                       ^~~~~~
                                       success
../../src/systemd/src/basic/alloc-util.h:169:50: note: expanded from macro 'msan_unpoison'
                                                 ^
../../src/systemd/src/basic/random-util.c:38:17: note: 'success' declared here
        uint8_t success;
                ^
1 error generated.
[80/545] Compiling C object 'src/basic/a6ba3eb@@basic@sta/process-util.c.o'.
ninja: build stopped: subcommand failed.
Fuzzers build failed
```

4 years agocgroup: Test that it's possible to set memory protection to 0 again 12445/head
Chris Down [Fri, 3 May 2019 12:40:11 +0000 (08:40 -0400)] 
cgroup: Test that it's possible to set memory protection to 0 again

The previous commit fixes this up, and this should prevent it
regressing.

4 years agocgroup: Support 0-value for memory protection directives
Chris Down [Fri, 3 May 2019 12:32:41 +0000 (08:32 -0400)] 
cgroup: Support 0-value for memory protection directives

These make sense to be explicitly set at 0 (which has a different effect
than the default, since it can affect processing of `DefaultMemoryXXX`).

Without this, it's not easily possible to relinquish memory protection
for a subtree, which is not great.

4 years agocgroup: Readd some plumbing for DefaultMemoryMin
Chris Down [Fri, 3 May 2019 12:19:05 +0000 (08:19 -0400)] 
cgroup: Readd some plumbing for DefaultMemoryMin

Somehow these got lost in the previous PR, rendering DefaultMemoryMin
not very useful.

4 years agocgroup: Polish hierarchically aware protection docs a bit
Chris Down [Tue, 30 Apr 2019 18:22:04 +0000 (14:22 -0400)] 
cgroup: Polish hierarchically aware protection docs a bit

I missed adding a section in `systemd.resource-control` about
DefaultMemoryMin in #12332.

Also, add a NEWS entry going over the general concept.

4 years agoMerge pull request #11887 from evverx/fuzzbuzz
Lennart Poettering [Wed, 8 May 2019 10:40:03 +0000 (12:40 +0200)] 
Merge pull request #11887 from evverx/fuzzbuzz

tests: hook up fuzz targets to FuzzBuzz

4 years agomachinectl/loginctl: show json output if requested even if zero entries 12509/head
Lennart Poettering [Mon, 6 May 2019 23:21:24 +0000 (01:21 +0200)] 
machinectl/loginctl: show json output if requested even if zero entries

4 years agoformat-table: correct prototype
Lennart Poettering [Mon, 6 May 2019 23:20:49 +0000 (01:20 +0200)] 
format-table: correct prototype

4 years agoMerge pull request #12489 from ssahani/vxlan
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 10:02:54 +0000 (12:02 +0200)] 
Merge pull request #12489 from ssahani/vxlan

networkd: VXLAN rename Id to VNI

4 years agoMerge pull request #12507 from poettering/random-fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 10:02:02 +0000 (12:02 +0200)] 
Merge pull request #12507 from poettering/random-fixlets

three minor fixes to random-util.c

4 years agojournalctl,shared/log: use yellow for warnings 12411/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 15:42:46 +0000 (17:42 +0200)] 
journalctl,shared/log: use yellow for warnings

In program output, highlighting warnings with ANSI_HIGHLIGHT is not enough,
because it doesn't stand out enough. Yellow is more appropriate.

I was worried that yellow wouldn't be visible on white background, but (at
least gnome-terminal) uses a fairly dark yellow that is fully legible on white
and light-colored backgrounds. We also used yellow in many places,
e.g. systemctl, so this should be fine.

Note: yellow is unreadable on urxvt with white background (urxvt +rv). But
grey, which we already used, is also unreadable, so urxvt users would have
to disable colors anyway, so this change does not make the problem
intrinsically worse. See
https://github.com/systemd/systemd/issues/12482#issuecomment-490374210.

4 years agoEnable log colors for most of tools in /usr/bin
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 10:28:25 +0000 (12:28 +0200)] 
Enable log colors for most of tools in /usr/bin

When emitting the calendarspec warning we want to see some color.
Follow-up for 04220fda5c.

Exceptions:
- systemctl, because it has a lot hand-crafted coloring
- tmpfiles, sysusers, stdio-bridge, etc, because they are also used in
  services and I'm not sure if this wouldn't mess up something.

4 years agobasic/log: use colors to highlight messages like journalctl
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 10:27:33 +0000 (12:27 +0200)] 
basic/log: use colors to highlight messages like journalctl

4 years agonetworkd: bridge fdb add support to configure VXLAN VNI
Susant Sahani [Mon, 6 May 2019 14:28:52 +0000 (19:58 +0530)] 
networkd: bridge fdb add support to configure VXLAN VNI

4 years agofuzz: fix spelling of MACsec and MACAddress in the corpus 12489/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:33:38 +0000 (20:33 +0200)] 
fuzz: fix spelling of MACsec and MACAddress in the corpus

4 years agocheck-directives: use diff to show what the differences really are
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:31:32 +0000 (20:31 +0200)] 
check-directives: use diff to show what the differences really are

This also makes the comparison more detailed, since we check spelling,
including case.

4 years agonetworkd: VXLAN use correct type for VNI
Susant Sahani [Tue, 7 May 2019 09:15:30 +0000 (14:45 +0530)] 
networkd: VXLAN use correct type for VNI

4 years agonetworkd: VXLAN add support to configure Generic Protocol Extension
Susant Sahani [Mon, 6 May 2019 19:10:57 +0000 (00:40 +0530)] 
networkd: VXLAN add support to configure Generic Protocol Extension

See https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07

4 years agoMerge pull request #12501 from keszybz/silence-strncpy-warnings
Lennart Poettering [Tue, 7 May 2019 23:39:32 +0000 (01:39 +0200)] 
Merge pull request #12501 from keszybz/silence-strncpy-warnings

Silence strncpy warnings

4 years agorandom-util: rename "err" to "success" 12507/head
Lennart Poettering [Tue, 7 May 2019 22:51:26 +0000 (18:51 -0400)] 
random-util: rename "err" to "success"

After all rdrand returns 1 on success, and 0 on failure, hence let's
name this accordingly.

4 years agotravis: make sure that the fuzz targets can be built on OSS-Fuzz 11887/head
Evgeny Vereshchagin [Sun, 5 May 2019 22:15:28 +0000 (22:15 +0000)] 
travis: make sure that the fuzz targets can be built on OSS-Fuzz

4 years agotravis: make sure the fuzz targets can be built on FuzzBuzz
Evgeny Vereshchagin [Sun, 5 May 2019 20:00:38 +0000 (20:00 +0000)] 
travis: make sure the fuzz targets can be built on FuzzBuzz

4 years agotests: hook up fuzz targets to FuzzBuzz
Evgeny Vereshchagin [Sun, 5 May 2019 19:28:42 +0000 (19:28 +0000)] 
tests: hook up fuzz targets to FuzzBuzz

4 years agorandom-util: hash AT_RANDOM getauxval() value before using it
Lennart Poettering [Tue, 7 May 2019 21:26:55 +0000 (17:26 -0400)] 
random-util: hash AT_RANDOM getauxval() value before using it

Let's be a bit paranoid and hash the 16 bytes we get from getauxval()
before using them. AFter all they might be used by other stuff too (in
particular ASLR), and we probably shouldn't end up leaking that seed
though our crappy pseudo-random numbers.

4 years agorandom-util: use gcc's bit_RDRND definition if it exists
Lennart Poettering [Tue, 7 May 2019 20:21:44 +0000 (16:21 -0400)] 
random-util: use gcc's bit_RDRND definition if it exists

4 years agorandom-util: rename RANDOM_DONT_DRAIN → RANDOM_MAY_FAIL
Lennart Poettering [Tue, 7 May 2019 20:18:13 +0000 (16:18 -0400)] 
random-util: rename RANDOM_DONT_DRAIN → RANDOM_MAY_FAIL

The old flag name was a bit of a misnomer, as /dev/urandom cannot be
"drained". Once it's initialized it's initialized and then is good
forever. (Only /dev/random has a concept of 'draining', but we never use
that, as it's an obsolete interface).

The flag is still useful though, since it allows us to suppress accesses
to the random pool while it is not initialized, as that trips up the
kernel and it logs about any such attempts, which we really don't want.

4 years agoscsi_serial: replace some crazy strncpy() calls by strnlen() 12501/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 13:58:29 +0000 (15:58 +0200)] 
scsi_serial: replace some crazy strncpy() calls by strnlen()

gcc was warning about strncpy() leaving an unterminated string.
In this case, it was correct.

The code was doing strncpy()+strncat()+strlen() essentially to determine
if the strings have expected length. If the length was correct, a buffer
overread was performed (or at least some garbage bytes were used from the
uninitialized part of the buffer). Let's do the length check first and then
only copy stuff if everything agrees.

For some reason the function was called "prepend", when it obviously does
an "append".

4 years agoshared/utmp-wtmp: silence gcc warning about strncpy truncation
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 13:10:58 +0000 (15:10 +0200)] 
shared/utmp-wtmp: silence gcc warning about strncpy truncation

Unfortunately the warning must be known, or otherwise the pragma generates a
warning or an error. So let's do a meson check for it.

Is it worth doing this to silence the warning? I think so, because apparently
the warning was already emitted by gcc-8.1, and with the recent push in gcc to
catch more such cases, we'll most likely only get more of those.

4 years agonetworkd: VXLan TTL must be <= 255
Susant Sahani [Mon, 6 May 2019 17:37:32 +0000 (23:07 +0530)] 
networkd: VXLan TTL must be <= 255

Ignore when TTL > 255

4 years agonetworkd: VXLan Make group and remote variable separate
Susant Sahani [Tue, 7 May 2019 05:14:06 +0000 (10:44 +0530)] 
networkd: VXLan Make group and remote variable separate

VXLAN Document Group=

4 years agoMerge pull request #12475 from yuwata/network-fix-12452
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:03:22 +0000 (20:03 +0200)] 
Merge pull request #12475 from yuwata/network-fix-12452

network: add network_ref/_unref() and make Link object take a reference of Network object

4 years agoMerge pull request #12481 from ssahani/dhcp-max-retry
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 17:58:40 +0000 (19:58 +0200)] 
Merge pull request #12481 from ssahani/dhcp-max-retry

networkd: Allow DHCP4 client to set the number to attempt to configure/reconfigure

4 years agonetworkd: VXLAN rename Id to VNI
Susant Sahani [Tue, 7 May 2019 05:01:22 +0000 (10:31 +0530)] 
networkd: VXLAN rename Id to VNI

It makes more sense to call VXLAN ID as

1. the VXLAN Network Identifier (VNI) (or VXLAN Segment ID)
2. test-network: rename VXLAN Id to VNI
3. fuzzer: Add VXLAN VNI directive to fuzzer

4 years agonetworkd: VXLAN ID define range in the man
Susant Sahani [Mon, 6 May 2019 11:58:48 +0000 (17:28 +0530)] 
networkd: VXLAN ID define range in the man

4 years agotest-network: add one more test for LinkLocalAddressing=fallback 12481/head
Yu Watanabe [Sun, 5 May 2019 15:42:05 +0000 (17:42 +0200)] 
test-network: add one more test for LinkLocalAddressing=fallback

4 years agonetwork: add error cause in the log
Yu Watanabe [Tue, 7 May 2019 13:54:15 +0000 (15:54 +0200)] 
network: add error cause in the log

4 years agonetworkd: Allow DHCP4 client to set the number to attempt to reconfigure.
Susant Sahani [Sat, 4 May 2019 11:40:54 +0000 (17:10 +0530)] 
networkd: Allow DHCP4 client to set the number to attempt to reconfigure.

Otherwise current value is 6 and after 6 it will give up.

4 years agonetwork: use IN_ADDR_NULL and ETHER_ADDR_NULL 12475/head
Yu Watanabe [Sat, 4 May 2019 18:14:08 +0000 (20:14 +0200)] 
network: use IN_ADDR_NULL and ETHER_ADDR_NULL

The change in manager_rtnl_process_address() may not be necessary,
but for safety, let's initialize the value.

4 years agonetwork: fix conditional jump depends on uninitialised value(s)
Yu Watanabe [Sat, 4 May 2019 18:03:44 +0000 (20:03 +0200)] 
network: fix conditional jump depends on uninitialised value(s)

When address is in IPv4, the remaining buffer in in_addr_union may
not be initialized.

Fixes the following valgrind warning:
```
==13169== Conditional jump or move depends on uninitialised value(s)
==13169==    at 0x137FF6: UnknownInlinedFun (networkd-ndisc.c:77)
==13169==    by 0x137FF6: UnknownInlinedFun (networkd-ndisc.c:580)
==13169==    by 0x137FF6: ndisc_handler.lto_priv.83 (networkd-ndisc.c:597)
==13169==    by 0x11BE23: UnknownInlinedFun (sd-ndisc.c:201)
==13169==    by 0x11BE23: ndisc_recv.lto_priv.174 (sd-ndisc.c:254)
==13169==    by 0x4AA18CF: source_dispatch (sd-event.c:2821)
==13169==    by 0x4AA1BC2: sd_event_dispatch (sd-event.c:3234)
==13169==    by 0x4AA1D88: sd_event_run (sd-event.c:3291)
==13169==    by 0x4AA1FAB: sd_event_loop (sd-event.c:3313)
==13169==    by 0x117401: UnknownInlinedFun (networkd.c:113)
==13169==    by 0x117401: main (networkd.c:120)
==13169==  Uninitialised value was created by a stack allocation
==13169==    at 0x1753C8: manager_rtnl_process_address (networkd-manager.c:479)
```

4 years agosd-radv: fix memleak
Yu Watanabe [Sat, 4 May 2019 16:08:23 +0000 (18:08 +0200)] 
sd-radv: fix memleak

Fixes one memleak found in #12452.

4 years agonetwork: fix use-after-free
Yu Watanabe [Sat, 4 May 2019 17:43:45 +0000 (19:43 +0200)] 
network: fix use-after-free

The function sd_radv_add_prefix() in dhcp6_pd_prefix_assign() may
return -EEXIST, and in that case the sd_radv_prefix object allocated
in dhcp6_pd_prefix_assign() will be freed when the function returns.
Hence, the key value in Manager::dhcp6_prefixes hashmap is lost.

4 years agonetwork: fix memleak and double free
Yu Watanabe [Sat, 4 May 2019 13:59:36 +0000 (15:59 +0200)] 
network: fix memleak and double free

Fixes the third issue in #12452.

4 years agonetwork: simplify link_free()
Yu Watanabe [Sat, 4 May 2019 13:33:17 +0000 (15:33 +0200)] 
network: simplify link_free()

4 years agonetwork: drop list fields in Network object
Yu Watanabe [Sat, 4 May 2019 11:02:18 +0000 (13:02 +0200)] 
network: drop list fields in Network object

4 years agonetworkd: manager do not unef netlink and gennetlink early
Susant Sahani [Thu, 2 May 2019 09:52:03 +0000 (15:22 +0530)] 
networkd: manager do not unef netlink and gennetlink early

Because of this the fd is getting closed and we getting errors
like
```
^Ceno1: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Cannot delete unreachable route for DHCPv6 delegated subnet 2a0a:...:fc::/62: Bad file descriptor
Assertion '*_head == _item' failed at ../systemd/src/network/networkd-route.c:126, function route_free(). Aborting.
Aborted
```

Closes one of https://github.com/systemd/systemd/issues/12452

4 years agonetwork: make Link objects take references of Network objects
Yu Watanabe [Sat, 4 May 2019 06:05:11 +0000 (08:05 +0200)] 
network: make Link objects take references of Network objects

4 years agonetwork: introduce reference counter for Network object
Yu Watanabe [Sat, 4 May 2019 05:52:38 +0000 (07:52 +0200)] 
network: introduce reference counter for Network object

4 years agoscsi_serial: replace &foo[n] by foo+n
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 12:56:01 +0000 (14:56 +0200)] 
scsi_serial: replace &foo[n] by foo+n

4 years agoshared/utmp-wtmp: avoid gcc warning about strncpy truncation
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 12:15:46 +0000 (14:15 +0200)] 
shared/utmp-wtmp: avoid gcc warning about strncpy truncation

The fact that strncpy does the truncation is the whole point here, and gcc
shouldn't warn about this. We can avoid the warning and simplify the
whole procedure by directly copying the interesting part.

4 years agonetwork: remove redunant link name in message
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 11:46:55 +0000 (13:46 +0200)] 
network: remove redunant link name in message

Fixes #12454.

gcc was complaining that the link->ifname argument is NULL. Adding
assert(link->ifname) right before the call has no effect. It seems that
gcc is confused by the fact that log_link_warning_errno() internally
calls log_object(), with link->ifname passed as the object. log_object()
is also a macro and is does a check whether the passed object is NULL.
So we have a check if something is NULL right next an unconditional use
of it where it cannot be NULL. I think it's a bug in gcc.

Anyway, we don't need to use link->ifname here. log_object() already prepends
the object name to the message.

4 years agoItalian translations: minor updates (#12494)
Daniele Medri [Tue, 7 May 2019 10:12:46 +0000 (12:12 +0200)] 
Italian translations: minor updates (#12494)

4 years agoMerge pull request #12478 from yuwata/wireguard-fwmark
Yu Watanabe [Tue, 7 May 2019 03:16:34 +0000 (05:16 +0200)] 
Merge pull request #12478 from yuwata/wireguard-fwmark

network: rename WireGuard.FwMark -> FirewallMark

4 years agoMerge pull request #12487 from mschiu77/acer-series-hwdb
Yu Watanabe [Tue, 7 May 2019 02:33:49 +0000 (04:33 +0200)] 
Merge pull request #12487 from mschiu77/acer-series-hwdb

Acer series hwdb

4 years agosd-dhcp: store number of trial in sd_dhcp_client::attempt
Yu Watanabe [Sun, 5 May 2019 15:10:22 +0000 (17:10 +0200)] 
sd-dhcp: store number of trial in sd_dhcp_client::attempt

Calling 2^n as attempt is misleading.

4 years agoMerge pull request #12440 from poettering/realloc-again
Zbigniew Jędrzejewski-Szmek [Mon, 6 May 2019 15:17:22 +0000 (17:17 +0200)] 
Merge pull request #12440 from poettering/realloc-again

another shot at the malloc_usable_size() thing

4 years agobasic/mountpoint-util: whitelist 'exfat' in fstype_can_uid_gid
Mike Gilbert [Wed, 1 May 2019 18:15:44 +0000 (14:15 -0400)] 
basic/mountpoint-util: whitelist 'exfat' in fstype_can_uid_gid

4 years agonetworkd: stop clients when networkd shuts down (#12463)
Susant Sahani [Mon, 6 May 2019 14:06:50 +0000 (19:36 +0530)] 
networkd: stop clients when networkd shuts down (#12463)

We not stopping the clients when networkd stops. They
should shut down cleanly and then we need to clean the DS.

One of requirements to implement
https://github.com/systemd/systemd/issues/10820.

```
^CBus bus-api-network: changing state RUNNING → CLOSED
DHCP SERVER: UNREF
DHCP SERVER: STOPPED
DHCP CLIENT (0x60943df0): STOPPED
veth-test: DHCP lease lost
veth-test: Removing address 192.168.5.31
NDISC: Stopping IPv6 Router Solicitation client
DHCP CLIENT (0x0): FREE
==24308==
==24308== HEAP SUMMARY:
==24308==     in use at exit: 8,192 bytes in 2 blocks
==24308==   total heap usage: 4,230 allocs, 4,228 frees, 1,209,732 bytes allocated
==24308==
==24308== LEAK SUMMARY:
==24308==    definitely lost: 0 bytes in 0 blocks
==24308==    indirectly lost: 0 bytes in 0 blocks
==24308==      possibly lost: 0 bytes in 0 blocks
==24308==    still reachable: 8,192 bytes in 2 blocks
==24308==         suppressed: 0 bytes in 0 blocks
==24308== Rerun with --leak-check=full to see details of leaked memory
==24308==
==24308== For lists of detected and suppressed errors, rerun with: -s
==24308== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==24308== could not unlink /tmp/vgdb-pipe-from-vgdb-to-24308-by-sus-on-Zeus
==24308== could not unlink /tmp/vgdb-pipe-to-vgdb-from-24308-by-sus-on-Zeus
==24308== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-24308-by-sus-on-Zeus

```

4 years agohwdb: update the Chuwi HI13 pattern (#12469)
pEJipE [Mon, 6 May 2019 13:55:22 +0000 (15:55 +0200)] 
hwdb: update the Chuwi HI13 pattern (#12469)

Correct the searching pattern for Chuwi Hi13. Follow-up for
c70b51a7b98c3538aba7bbfee455b850b0aa714e.

4 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Sat, 4 May 2019 14:40:04 +0000 (11:40 -0300)] 
Update Brazilian Portuguese translation

4 years agoSystemd Catalog, Italian translation: minor updates (#12483)
Daniele Medri [Mon, 6 May 2019 13:27:21 +0000 (15:27 +0200)] 
Systemd Catalog, Italian translation: minor updates (#12483)

4 years agohwdb: add Medion Akoya E3222 MD62450 to 60-sensor.hwdb (#12485)
mpe85 [Mon, 6 May 2019 13:18:26 +0000 (15:18 +0200)] 
hwdb: add Medion Akoya E3222 MD62450 to 60-sensor.hwdb (#12485)

4 years agotest: return a non-zero return code when 'nobody' user doesn't exist
Frantisek Sumsal [Mon, 6 May 2019 08:48:12 +0000 (10:48 +0200)] 
test: return a non-zero return code when 'nobody' user doesn't exist

Lookup of a non-existing user using getpwnam() is not considered
an error, thus the `errno` is not set appropriately, causing
unexpected fails on systems, where 'nobody' user doesn't exist by
default