]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd/sd-network/network-util.c
724c2b85495b4711d62b473f9156ac6920a1fae8
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright 2014 Lennart Poettering
6 #include "alloc-util.h"
8 #include "network-util.h"
11 bool network_is_online(void) {
12 _cleanup_free_
char *state
= NULL
;
15 r
= sd_network_get_operational_state(&state
);
16 if (r
< 0) /* if we don't know anything, we consider the system online */
19 if (STR_IN_SET(state
, "routable", "degraded"))