- _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
- int r, if_loopback, counter = 0;
- bool eperm = false;
- struct in_addr ipv4_address;
-
- errno = 0;
- if_loopback = (int) if_nametoindex("lo");
- if (if_loopback <= 0)
- return errno ? -errno : -ENODEV;
-
- ipv4_address.s_addr = htonl(INADDR_LOOPBACK);
-
- r = sd_rtnl_open(0, &rtnl);
- if (r < 0)
- return r;
-
- r = add_addresses(rtnl, if_loopback, &ipv4_address, &counter);
- if (r < 0)
- return r;