summaryrefslogtreecommitdiff
path: root/src/libsystemd
Commit message (Collapse)AuthorAgeFilesLines
* fileio: introduce read_full_virtual_file() for reading virtual files in ↵Franck Bui2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* network: support matching based on wifi interfece typeYu Watanabe2019-10-251-0/+1
|
* Merge pull request #13836 from systemd/assert-cleanups-and-constificationYu Watanabe2019-10-257-47/+47
|\ | | | | Assert cleanups and constification
| * sd-netlink: constify object pointers passed to gettersZbigniew Jędrzejewski-Szmek2019-10-246-43/+43
| | | | | | | | | | | | | | | | | | sd-netlink is not public yet, so we can change the interface. I did not touch interfaces of functions like sd_netlink_wait() and sd_rtnl_message_new_link() which do not modify the object that is passed in, because in the future we might want to change the code to e.g. take a reference to the parent object or otherwise require a non-const reference.
| * sd-device: allow sd_device_get_devtype to be called with NULL arg and do not ↵Zbigniew Jędrzejewski-Szmek2019-10-241-4/+4
| | | | | | | | | | | | | | assert We shouldn't call assert() on user-specified arguments in public functions. While at it, let's return 1 if the type exists, and 0 otherwise.
* | basic/fs-util: change CHASE_OPEN flag into a separate output parameterZbigniew Jędrzejewski-Szmek2019-10-241-2/+2
|/ | | | | | | | | | | | | chase_symlinks() would return negative on error, and either a non-negative status or a non-negative fd when CHASE_OPEN was given. This made the interface quite complicated, because dependning on the flags used, we would get two different "types" of return object. Coverity was always confused by this, and flagged every use of chase_symlinks() without CHASE_OPEN as a resource leak (because it would this that an fd is returned). This patch uses a saparate output parameter, so there is no confusion. (I think it is OK to have functions which return either an error or an fd. It's only returning *either* an fd or a non-fd that is confusing.)
* sd-netlink: add nl80211 type systemsYu Watanabe2019-10-152-0/+35
|
* sd-netlink: introduce sd_genl_message_get_family()Yu Watanabe2019-10-151-0/+16
|
* sd-netlink: support NLMSG_DONEYu Watanabe2019-10-152-1/+4
|
* sd-netlink: save dynamic general netlink message typeYu Watanabe2019-10-1510-34/+128
|
* sd-netlink: drop unnecessarily exported variablesYu Watanabe2019-10-151-2/+0
|
* sd-netlink: introduce sd_netlink_message_read_string_strdup()Yu Watanabe2019-10-151-0/+26
|
* sd-netlink: use structured initializerYu Watanabe2019-10-151-4/+6
|
* sd-netlink: drop unused variableYu Watanabe2019-10-151-2/+0
|
* sd-netlink: add missing license identifierYu Watanabe2019-10-151-0/+2
|
* network: introduce ip nexthop routingSusant Sahani2019-10-145-1/+103
| | | | | | | | | | Used to manipulate entries in the kernel's nexthop tables. Example: ``` [NextHop] Id=3 Gateway=192.168.5.1 ```
* Merge pull request #13246 from keszybz/add-SystemdOptions-efi-variableZbigniew Jędrzejewski-Szmek2019-10-031-1/+1
|\ | | | | Add efi variable to augment /proc/cmdline
| * basic/cgroup-util: let cgroup_unified_flush() return the detected hierarchyZbigniew Jędrzejewski-Szmek2019-09-161-1/+1
| | | | | | | | | | | | | | This avoid the use of the global variable. Also rename cgroup_unified_update() to cgroup_unified_cached() and cgroup_unified_flush() to cgroup_unified() to better reflect their new roles.
* | sd-event: explicitly ignore waitipid()'s return valueFrantisek Sumsal2019-10-011-1/+1
| | | | | | | | Fixes CID#1393252
* | Merge pull request #11883 from yuwata/network-dhcp-renewYu Watanabe2019-09-222-0/+2
|\ \ | | | | | | network: dhcp renew
| * | network: introduce new bus method Renew() and RenewLink()Yu Watanabe2019-09-212-0/+2
| | |
* | | network: DHCP server Add support to transmit SIP serverSusant Sahani2019-09-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. DHCP server trasmit 2. Client parses and saves in leases Implements http://www.rfc-editor.org/rfc/rfc3361.txt ``` Frame 134: 348 bytes on wire (2784 bits), 348 bytes captured (2784 bits) on interface 0 Ethernet II, Src: 42:65:85:d6:4e:32 (42:65:85:d6:4e:32), Dst: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) 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: 0x7cc87cb4 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.1.1 Option: (120) SIP Servers <=====here Length: 9 SIP Server Encoding: IPv4 Address (1) SIP Server Address: 192.168.1.1 SIP Server Address: 192.168.5.2 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ``` ``` cat /run/systemd/netif/state  ✔  ⚡  3148  16:40:51 OPER_STATE=routable CARRIER_STATE=carrier ADDRESS_STATE=routable DNS=192.168.94.2 192.168.5.1 NTP=192.168.5.1 SIP=192.168.1.1 192.168.5.2 ``` aa
* | | sd-netlink: fix invalid assertionYu Watanabe2019-09-171-1/+3
| |/ |/| | | | | | | | | It is natural that n_attiributes is less than type. But in that case, the message does not contain any message about the type. So, we should not abort execution with assertion, but just return -ENODATA.
* | sd-network: add support to get DHCP4 addressSusant Sahani2019-09-091-0/+4
| |
* | sd-bus: adjust indentation of commentsZbigniew Jędrzejewski-Szmek2019-08-271-2/+1
| |
* | test-bus-vtable: also print introspection for the fallback vtableZbigniew Jędrzejewski-Szmek2019-08-272-3/+25
| | | | | | | | | | This doesn't really test anything, it's just a trivial test that we get the expected output for a fallback vtable.
* | Merge pull request #13365 from keszybz/fix-commits-from-pr-13246Zbigniew Jędrzejewski-Szmek2019-08-221-2/+2
|\ \ | | | | | | Fix commits from #13246
| * | test-event: stop debugging spewZbigniew Jędrzejewski-Szmek2019-08-201-2/+2
| | | | | | | | | | | | | | | Ubuntu autopkgtests print output from all tests, and test-event produces a lot of it. Let's cut it down to reasonable size.
* | | networkd: Keep track of static neighborsWilliam A. Kennington III2019-08-122-1/+8
| | | | | | | | | | | | | | | We need to keep track of the static neighbors that are configured on the interface so that we can delete stale entries that were removed.
* | | sd-hwdb: use return value from ordered_hashmap_iterate()Zbigniew Jędrzejewski-Szmek2019-08-031-2/+1
|/ / | | | | | | Why not? Coverity CID#1402329.
* | Add IFLA_BR_MCAST_IGMP_VERSIONShreyas Behera2019-07-251-0/+1
| |
* | netlink: move local-addresses.[ch] to src/sharedLennart Poettering2019-07-244-317/+0
| | | | | | | | | | | | | | This code is not part of the public API of sd-netlink, nor used by it internally and hence should not be in the sd-netlink directory. Also, move the test case for it to src/test/.
* | sd-netlink: update commentYu Watanabe2019-07-191-1/+1
|/
* sd-device: voidify and simplify calls to ordered_hashmap_iterate()Zbigniew Jędrzejewski-Szmek2019-07-171-10/+2
| | | | Coverity CID#1402356 and CID#1402335.
* sd-bus: voidify two calls to hashmap_iterate()Zbigniew Jędrzejewski-Szmek2019-07-171-2/+2
| | | | Coverity CID#1402304 and CID#1402307.
* tree-wide: drop duplicated blank linesYu Watanabe2019-07-152-2/+0
| | | | | | | ``` $ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done $ git checkout HEAD -- basic/linux shared/linux ```
* tree-wide: get rid of strappend()Lennart Poettering2019-07-123-9/+8
| | | | | It's a special case of strjoin(), so no need to keep both. In particular as typing strjoin() is even shoert than strappend().
* Merge pull request #13017 from yuwata/network-neighbor-lladdr-13015Lennart Poettering2019-07-112-2/+2
|\ | | | | network: rename Neighbor.MACAddress= and also support IPv4 address
| * network: NDA_LLADDR attribute can also take struct in_addrYu Watanabe2019-07-111-1/+1
| |
| * sd-netlink: make sd_netlink_message_read() returns size of read dataYu Watanabe2019-07-111-1/+1
| |
* | core: expose new clean operation on the busLennart Poettering2019-07-111-0/+2
| | | | | | | | | | This adds CanClean() and Clean() as new methods on the Unit object that initiate the cleaning operation.
* | sd-bus: when installing a match make sure not to apply it to already queued ↵Lennart Poettering2019-07-115-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | messages This tweaks match installation a bit: the match callbacks are now only called for messages read after the AddMatch() reply was received and never anything already read before. Thus, installing a match gives you a time guarantee: only messages received after it will be matched. This is useful when listening to PropertiesChanged signals as an example to ensure that only changes after the point the match was installed are honoured, nothing before.
* | sd-bus: destroy AddMatch() reply slot in failure case tooLennart Poettering2019-07-111-2/+3
| | | | | | | | | | | | | | | | If AddMatch() doesn't work, let's destroy the slot for it too as soon as we received the failure for it. This way the mere existance of the slot tells us whether the AddMatch() method call is still pending or is complete.
* | sd-bus: maintain a counter for incoming msgsLennart Poettering2019-07-114-0/+11
|/ | | | | | Let's count incoming messages and attach the current counter when we first read them to the message objects. This allows us to nicely order messages later on.
* Merge pull request #12926 from keszybz/urlify-logsLennart Poettering2019-07-111-1/+1
|\ | | | | Urlify CONFIG_FILE and improve SYSTEMD_LOG_LOCATION
| * tree-wide: use PROJECT_FILE instead of __FILE__Zbigniew Jędrzejewski-Szmek2019-07-041-1/+1
| | | | | | | | This replaces the internal uses of __FILE__ with the new macro.
* | Merge pull request #12863 from 1848/if_xfrmYu Watanabe2019-07-102-0/+9
|\ \ | | | | | | Added support for xfrm interfaces
| * | Added support for xfrm interfaces18482019-07-102-0/+9
| | |
* | | tree-wide: introduce strerror_safe()Yu Watanabe2019-07-053-3/+5
| | |
* | | sd-event: replace snprintf() with strpcpyf()Yu Watanabe2019-07-051-6/+8
|/ /