1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 3 #include "format-util.h" 4 #include "network-common.h" 5 get_ifname(int ifindex,char ** ifname)6int get_ifname(int ifindex, char **ifname) { 7 assert(ifname); 8 9 /* This sets ifname only when it is not set yet. */ 10 11 if (*ifname) 12 return 0; 13 14 return format_ifname_alloc(ifindex, ifname); 15 } 16