]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd/sd-network/network-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2014 Lennart Poettering
8 #include "alloc-util.h"
10 #include "network-util.h"
13 bool network_is_online(void) {
14 _cleanup_free_
char *state
= NULL
;
17 r
= sd_network_get_operational_state(&state
);
18 if (r
< 0) /* if we don't know anything, we consider the system online */
21 if (STR_IN_SET(state
, "routable", "degraded"))