chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
environment: append unit_id to error messages regarding EnvironmentFile
[elogind.git]
/
src
/
shared
/
in-addr-util.c
diff --git
a/src/shared/in-addr-util.c
b/src/shared/in-addr-util.c
index 459f8461738f935fc0c09af5ce6e70e00af3c5d6..457eedd6d81825f519984f06884cc0c91ab4c6c0 100644
(file)
--- a/
src/shared/in-addr-util.c
+++ b/
src/shared/in-addr-util.c
@@
-242,3
+242,9
@@
int in_addr_from_string_auto(const char *s, int *family, union in_addr_union *re
return -EINVAL;
}
+
+unsigned in_addr_netmask_to_prefixlen(const struct in_addr *addr) {
+ assert(addr);
+
+ return 32 - u32ctz(be32toh(addr->s_addr));
+}