| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |\
| |
| | |
Assert cleanups and constification
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Used to manipulate entries in the kernel's nexthop tables.
Example:
```
[NextHop]
Id=3
Gateway=192.168.5.1
```
|
| |\
| |
| | |
Add efi variable to augment /proc/cmdline
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Fixes CID#1393252
|
| |\ \
| | |
| | | |
network: dhcp renew
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |/
|/|
| |
| |
| |
| | |
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.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
This doesn't really test anything, it's just a trivial test that we
get the expected output for a fallback vtable.
|
| |\ \
| | |
| | | |
Fix commits from #13246
|
| | | |
| | |
| | |
| | |
| | | |
Ubuntu autopkgtests print output from all tests, and test-event produces
a lot of it. Let's cut it down to reasonable size.
|
| | | |
| | |
| | |
| | |
| | | |
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.
|
| |/ /
| |
| |
| | |
Why not? Coverity CID#1402329.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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/.
|
| |/ |
|
| |
|
|
| |
Coverity CID#1402356 and CID#1402335.
|
| |
|
|
| |
Coverity CID#1402304 and CID#1402307.
|
| |
|
|
|
|
|
| |
```
$ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done
$ git checkout HEAD -- basic/linux shared/linux
```
|
| |
|
|
|
| |
It's a special case of strjoin(), so no need to keep both. In particular
as typing strjoin() is even shoert than strappend().
|
| |\
| |
| | |
network: rename Neighbor.MACAddress= and also support IPv4 address
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
This adds CanClean() and Clean() as new methods on the Unit object that
initiate the cleaning operation.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |/
|
|
|
|
| |
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.
|
| |\
| |
| | |
Urlify CONFIG_FILE and improve SYSTEMD_LOG_LOCATION
|
| | |
| |
| |
| | |
This replaces the internal uses of __FILE__ with the new macro.
|
| |\ \
| | |
| | | |
Added support for xfrm interfaces
|
| | | | |
|
| | | | |
|
| |/ / |
|