diff options
author | Dan Streetman <ddstreet@canonical.com> | 2020-05-02 15:56:33 +0200 |
---|---|---|
committer | Dan Streetman <ddstreet@canonical.com> | 2020-05-26 15:52:50 +0200 |
commit | 6b8a1aa6a37b59565e400a379a27ac60ce59f895 (patch) | |
tree | f4efdb3cabfeae319a378b917ef34c297565a5d2 /src/libsystemd-network/sd-ipv4ll.c | |
parent | network: Change IgnoreCarrierLoss default to value of ConfigureWithoutCarrier (diff) | |
download | systemd-6b8a1aa6a37b59565e400a379a27ac60ce59f895.tar.xz systemd-6b8a1aa6a37b59565e400a379a27ac60ce59f895.zip |
network: return 1 on start and 0 if ipv4ll is already started
Instead of -EBUSY, return 0 from sd_ipv4ll_start() if it's already started,
and change successful start return value to 1.
This matches sd_ndisc_start() behavior; 1 indicates successful start, and
0 indicates already started.
Diffstat (limited to 'src/libsystemd-network/sd-ipv4ll.c')
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index aa1ece41d2..4f4d9ebe87 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -252,12 +252,14 @@ static int ipv4ll_start_internal(sd_ipv4ll *ll, bool reset_generation) { return r; } - return 0; + return 1; } int sd_ipv4ll_start(sd_ipv4ll *ll) { assert_return(ll, -EINVAL); - assert_return(sd_ipv4ll_is_running(ll) == 0, -EBUSY); + + if (sd_ipv4ll_is_running(ll)) + return 0; return ipv4ll_start_internal(ll, true); } |