]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-dhcp-client: merge client_send_release() into sd_dhcp_client_send_release()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 2 Oct 2019 08:22:49 +0000 (10:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 2 Oct 2019 12:01:42 +0000 (14:01 +0200)
commit8ff4585ffa870bce1a02dbf53cfcae7f559c3e83
tree6080fcd6e87689084f488c48bf7807e9ad338118
parent5f3b5f190fe5b106d18924e14a5148ed1519f6d6
sd-dhcp-client: merge client_send_release() into sd_dhcp_client_send_release()

The public function and the implementation were split into two for
no particular reason.

We would assert() on the internal state of the client. This should not be done
in a function that is directly called from a public function. (I.e., we should
not crash if the public function is called at the wrong time.)
assert() is changed to assert_return().

And before anyone asks: I put the assert_returns() *above* the internal
variables on purpose. This makes it easier to see that the assert_returns()
are about the state that is passed in, and if they are not satisfied, the
function returns immediately. The compiler doesn't care either way, so
the ordering that is clearest to the reader should be chosen.
src/libsystemd-network/sd-dhcp-client.c