chiark / gitweb /
core: fixate show_status earlier, so that we actually print the welcome message
[elogind.git] / src / shared / net-util.c
index 887dae51251647a16a2e6d1115b7a9c69302fa94..ba21ae437f3da968aae980c584a32c07a0ffca1c 100644 (file)
@@ -58,6 +58,12 @@ bool net_match_config(const struct ether_addr *match_mac,
         return 1;
 }
 
+unsigned net_netmask_to_prefixlen(const struct in_addr *addr) {
+        assert(addr);
+
+        return 32 - u32ctz(be32toh(addr->s_addr));
+}
+
 int config_parse_ifname(const char *unit,
                         const char *filename,
                         unsigned line,