summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-10-31qdisc: netem add support to duplicate packets.Susant Sahani3-6/+17
using this option the chosen percent of packets is duplicated before queuing them
2019-10-31Merge pull request #13510 from medhefgo/bootZbigniew Jędrzejewski-Szmek3-31/+18
sd-boot: Be silent on regular boots
2019-10-31networkd: dhcp server Support Vendor specific 43Susant Sahani9-8/+347
Implementes https://tools.ietf.org/html/rfc2132 ``` [DHCPServer] SendRawOption=26:uint32:1400 SendRawOption=23:uint8:10 ``` Frame 448: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0 Linux cooked capture Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11 User Datagram Protocol, Src Port: 67, Dst Port: 68 Dynamic Host Configuration Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x71f8de9d Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 192.168.5.11 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (3600s) 1 hour Option: (1) Subnet Mask (255.255.255.0) Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.5.1 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.5.1 Option: (42) Network Time Protocol Servers Length: 4 Network Time Protocol Server: 192.168.5.1 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (43) Vendor-Specific Information Length: 9 Value: 1701311a0431343030 Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ```
2019-10-30Merge pull request #13884 from poettering/event-fd-close-fixAnita Zhang1-1/+3
sd-event: don't invalidate source type on disconnect
2019-10-30calendarspec: fix calculation of timespec iterations that fall onto a DST changeZbigniew Jędrzejewski-Szmek1-20/+34
If we tested a candidate time that would fall onto the DST change, and we realized that it is now a valid time ('cause the given "hour" is missing), we would jump to to beginning of the next bigger time period, i.e. the next day. mktime_or_timegm() already tells us what the next valid time is, so let's reuse this, and continue the calculations at this point. This should allow us to correctly jump over DST changes, but also leap seconds and similar. It should be OK even multiple days were removed from calendar, similarly to the Gregorian-Julian transition. By reusing the information from normalization, we don't have to make assumptions what the next valid time is. Fixes #13745. $ TZ=Australia/Sydney faketime '2019-10-06 01:50' build/systemd-analyze calendar 0/1:0/1 --iterations 20 | grep Iter Iter. #2: Sun 2019-10-06 01:52:00 AEST Iter. #3: Sun 2019-10-06 01:53:00 AEST Iter. #4: Sun 2019-10-06 01:54:00 AEST Iter. #5: Sun 2019-10-06 01:55:00 AEST Iter. #6: Sun 2019-10-06 01:56:00 AEST Iter. #7: Sun 2019-10-06 01:57:00 AEST Iter. #8: Sun 2019-10-06 01:58:00 AEST Iter. #9: Sun 2019-10-06 01:59:00 AEST Iter. #10: Sun 2019-10-06 03:00:00 AEDT Iter. #11: Sun 2019-10-06 03:01:00 AEDT Iter. #12: Sun 2019-10-06 03:02:00 AEDT Iter. #13: Sun 2019-10-06 03:03:00 AEDT Iter. #14: Sun 2019-10-06 03:04:00 AEDT Iter. #15: Sun 2019-10-06 03:05:00 AEDT Iter. #16: Sun 2019-10-06 03:06:00 AEDT Iter. #17: Sun 2019-10-06 03:07:00 AEDT Iter. #18: Sun 2019-10-06 03:08:00 AEDT Iter. #19: Sun 2019-10-06 03:09:00 AEDT Iter. #20: Sun 2019-10-06 03:10:00 AEDT $ TZ=Australia/Sydney faketime 2019-10-06 build/systemd-analyze calendar 2/4:30 --iterations=3 Original form: 2/4:30 Normalized form: *-*-* 02/4:30:00 Next elapse: Sun 2019-10-06 06:30:00 AEDT (in UTC): Sat 2019-10-05 19:30:00 UTC From now: 5h 29min left Iter. #2: Sun 2019-10-06 10:30:00 AEDT (in UTC): Sat 2019-10-05 23:30:00 UTC From now: 9h left Iter. #3: Sun 2019-10-06 14:30:00 AEDT (in UTC): Sun 2019-10-06 03:30:00 UTC From now: 13h left
2019-10-30sd-boot: Silence compiler warning when building with -O2Jan Janssen1-9/+5
2019-10-30sd-boot: Don't loudly complain if RNG protocol isn't availableJan Janssen1-21/+6
Fixes #13503
2019-10-30sd-event: don't invalidate source type on disconnectLennart Poettering1-1/+3
This fixes fd closing if fd ownership is requested.
2019-10-30sd-boot: Only disable optimization on debug buildsJan Janssen1-1/+7
2019-10-30analyze: fix minor memleakLennart Poettering1-1/+1
2019-10-30analyze: sort list of unknown syscalls kernel implementsLennart Poettering1-4/+10
2019-10-30seccomp: add new Linux 5.3 syscalls to syscall filter listsLennart Poettering1-0/+12
Many syscalls added and all fit nicely into existing groups, hence lets add them there.
2019-10-30network: cleanup header inclusionYu Watanabe48-133/+113
2019-10-30Merge pull request #13870 from irtimmer/check_ip_gnutlsZbigniew Jędrzejewski-Szmek2-6/+12
resolved: validate IP address in certificate for DNS-over-TLS (GnuTLS)
2019-10-30Merge pull request #13874 from keszybz/network-sendoption-cleanupsZbigniew Jędrzejewski-Szmek3-12/+11
Network SendOption cleanups
2019-10-30Merge pull request #13866 from keszybz/nspawn-restartsLennart Poettering13-25/+122
Make 'machinectl reboot' functional
2019-10-30network: amend SendOption= to take a c-escaped stringZbigniew Jędrzejewski-Szmek1-8/+7
No need to punish users by forcing them to do base64 encodings.
2019-10-30network: rename SendOptions= to SendOption=Zbigniew Jędrzejewski-Szmek3-4/+4
The name with plural made more sense where multiple options could be specified in one line. After changes in the pull request, this option only accepts one value, so from users' POV it should be singular. (The field in the data structure remains plural, because it actually stores multiple values.)
2019-10-30Merge pull request #13747 from ssahani/tc-qdiscYu Watanabe17-1/+1851
network: introduce Traffic Control
2019-10-30Merge pull request #13867 from keszybz/man-conditionYu Watanabe1-1/+1
Refactor description of conditons
2019-10-30network: wait for QDiscs to be configuredYu Watanabe3-4/+36
2019-10-30network: introduce TrafficControlSusant Sahani17-1/+1819
Add network delay to a interface
2019-10-29resolved: check for IP in certificate when using DoT with GnuTLSIwan Timmer2-2/+12
Validate the IP address in the certificate for DNS-over-TLS in strict mode when GnuTLS is used. As this is not yet the case in contrast to the documentation.
2019-10-29resolved: require at least version 3.6.0 of GnuTLS for DNS-over-TLSIwan Timmer1-4/+0
Increase the required version to ensure TLS 1.3 is always supported when using GnuTLS for DNS-over-TLS and allow further changes to use recent API additions.
2019-10-29Merge pull request #13864 from fbuihuu/no-more-swap-autoactivationZbigniew Jędrzejewski-Szmek5-23/+12
No more swap autoactivation
2019-10-29machined: only Unref units that we AddRef'dZbigniew Jędrzejewski-Szmek2-3/+8
b92d0b4c5adef37e9de8f6cc22a0e27b97fcf3ad added AddRef to the StartTransientUnit call in machine_start_scope()/manager_start_scope() and a corresponding Unref call in machine_stop_scope(). But when we are running systemd-nspawn@ with --keep unit, the unit is not created by machined so the AddRef never happens. Then when trying to stop the unit, we'd get: systemd-machined[1101]: Sent message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnrefUnit cookie=37 reply_cookie=0 signature=s error-name=n/a error-message=n/a systemd-machined[1101]: Got message type=error sender=:1.1 destination=:1.13 path=n/a interface=n/a member=n/a cookie=2443 reply_cookie=37 signature=s error-name=org.freedesktop.systemd1.NotReferenced error-message=Unit has not been referenced yet. systemd-machined[1101]: Failed to drop reference to machine scope, ignoring: Unit has not been referenced yet.
2019-10-29shared/logs-show: strip trailing carriage returns at EOL/EOFZbigniew Jędrzejewski-Szmek3-5/+38
When showing logs from a container, we would fail to show various lines: Oct 29 09:50:51 krowka systemd-nspawn[61376]: Detected architecture x86-64. Oct 29 09:50:51 krowka systemd-nspawn[61376]: [1B blob data] Oct 29 09:50:51 krowka systemd-nspawn[61376]: Welcome to Fedora 32 (Rawhide)! Oct 29 09:50:51 krowka systemd-nspawn[61376]: [1B blob data] Those are only harmless \r characters that trail the line. We already replace tabs and strip various ansi characters that we deem inconsequential, so let's also strip trailing carriage returns. Non-trailing ones are different, because they change what would be displayed.
2019-10-29nspawn: when stopping the machine, just deregister the machineZbigniew Jędrzejewski-Szmek3-10/+10
We already shut the machine down ourselves (and pid1 will also do cleanup for us after we exit if anything was left behind). No need for systemd-machined to try to stop the unit too. (This calls the new machined method. If we are running against an older machined, we will not deregister the machine. If we are simply exiting, machined should notice that the unit is gone on its own. If we are restarting, we will fail to register the machine after restart and fail. But this case was already broken, because machined would create a stop job, breaking the restart. So not doing anything with old machined should not make anything more broken than it already is.) Fixes #13766.
2019-10-29machined: add UnregisterMachine methodZbigniew Jędrzejewski-Szmek5-1/+42
This is the opposite of RegisterMachine: machined knows that the machine is "gone", but doesn't do anything on its own. We already had TerminateMachine, but that would stop the unit, which isn't always wanted.
2019-10-29pid1: log the reason why restart will or will not happenZbigniew Jędrzejewski-Szmek1-6/+24
I was trying to figure out why the restart was not happening, and it wasn't at all obvious. Let's add a nice debug message.
2019-10-29network-generator: Add missing help for --rootDavid Pedersen1-0/+1
2019-10-28shared: small typoZbigniew Jędrzejewski-Szmek1-1/+1
2019-10-28core: drop 'wants' parameter from unit_add_node_dependency()Franck Bui5-18/+8
Since Wants dependency is no more automagically added to swap and mount units, this parameter is no more used hence this patch drops it.
2019-10-28swap: do not make swap units wanted by its device unit anymoreFranck Bui1-6/+5
It was done for mount units already (see commit 142b8142d7bb84f07). For the same reasons and for consistency we should also stop activating automagically swaps when their device is hot-plugged.
2019-10-28Merge pull request #13423 from pwithnall/12035-session-time-limitsZbigniew Jędrzejewski-Szmek6-18/+90
Add `RuntimeMaxSec=` support to scope units (time-limited login sessions)
2019-10-28modules-load: do not fail service if modules are not presentZbigniew Jędrzejewski-Szmek1-2/+4
It is pretty common for the service to fail in the initramfs (for example because certain modules have not been copied over or haven't been built yet in case of dkms modules). This seems to be more trouble than it is worth. Let's change the service to simply log any missing modules at error level, but not fail the whole service. https://bugzilla.redhat.com/show_bug.cgi?id=1254340
2019-10-28Merge pull request #13844 from keszybz/resolved-proprtiesYu Watanabe9-19/+42
Emit dbus PropertyChanged notifications for systemd-resolved
2019-10-28pid1: order .automount units after local-fs-pre.targetZbigniew Jędrzejewski-Szmek1-0/+4
From the bug: > According to the documentation of systemd.automount if the automoint point is > automagically created if it doesn't exist yet. This ofcourse means the > filesystem underneath has to be writable, which for / means not only does > -.mount need to be started but also systemd-remount-fs.service has to be run, > which isn't guaranteed by the default automount dependencies. > > For .mount units there is an automatic default After= dependency on > local-fs-pre.target, would probably make sense to do the same for automount > units to avoid it failing on the corner-case where it has to create directory. Fixes #13306.
2019-10-28pam_systemd: Forward systemd.runtime_max_sec setting to session scopePhilip Withnall1-3/+29
Allow earlier PAM modules to set `systemd.runtime_max_sec`. If they do, parse it and set it as the `RuntimeMaxUSec=` property of the session scope, to limit the maximum lifetime of the session. This could be useful for time-limiting login sessions, for example. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #12035
2019-10-28scope: Support RuntimeMaxSec= directive in scope unitsPhilip Withnall5-2/+27
Just as `RuntimeMaxSec=` is supported for service units, add support for it to scope units. This will gracefully kill a scope after the timeout expires from the moment the scope enters the running state. This could be used for time-limited login sessions, for example. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #12035
2019-10-28Merge pull request #13635 from fbuihuu/no-aliases-with-enableZbigniew Jędrzejewski-Szmek2-3/+5
man: alias names can't be used with enable command
2019-10-25shared/sleep-config: two more error handling fixes, use structured ↵Zbigniew Jędrzejewski-Szmek1-13/+14
initialization CID#1406472.
2019-10-25shared/sleep-config: fix error handling for openZbigniew Jędrzejewski-Szmek1-3/+2
CID#1406472.
2019-10-25resolved: emit change for CurrentDNSServerZbigniew Jędrzejewski-Szmek2-1/+4
2019-10-25resolved: emit change for LLMNRHostnameZbigniew Jędrzejewski-Szmek2-2/+6
2019-10-25resolved: send out notifications about DNS propertyZbigniew Jędrzejewski-Szmek4-1/+22
Notifications are only sent for the top object, and not for individual links. This should be enough for the most obvious cases where somebody just cares about the effective set of servers. Fixes #13721.
2019-10-25resolved: make two functions staticZbigniew Jędrzejewski-Szmek2-5/+2
2019-10-25resolved: one less {}Zbigniew Jędrzejewski-Szmek1-2/+1
2019-10-25resolved: avoid allocationZbigniew Jędrzejewski-Szmek4-8/+7
While at it, constify the argument.
2019-10-25fileio: introduce read_full_virtual_file() for reading virtual files in ↵Franck Bui3-5/+113
sysfs, procfs Virtual filesystems such as sysfs or procfs use kernfs, and kernfs can work with two sorts of virtual files. One sort uses "seq_file", and the results of the first read are buffered for the second read. The other sort uses "raw" reads which always go direct to the device. In the later case, the content of the virtual file must be retrieved with a single read otherwise subsequent read might get the new value instead of finding EOF immediately. That's the reason why the usage of fread(3) is prohibited in this case as it always performs a second call to read(2) looking for EOF which is subject to the race described previously. Fixes: #13585.