summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/network-common.c
blob: b8b4ecdaae4e1d27ec326f87e6934de755f02073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#include "format-util.h"
#include "network-common.h"

int get_ifname(int ifindex, char **ifname) {
        assert(ifname);

        /* This sets ifname only when it is not set yet. */

        if (*ifname)
                return 0;

        return format_ifname_alloc(ifindex, ifname);
}