]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
in-addr-util: add byte accessor array to union in_addr_union
authorLennart Poettering <lennart@poettering.net>
Sun, 16 Aug 2020 09:28:34 +0000 (11:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 26 Aug 2020 14:46:12 +0000 (16:46 +0200)
It's pretty useful to be able to access the bytes generically, without
acknowledging a specific family, hence let's a third way to access an
in_addr_union.

src/basic/in-addr-util.h

index dc3f575bc977dfd0195a38f43722c5f0b22b56d5..03583f25661bc44e742b037a1909470d181000e4 100644 (file)
@@ -12,6 +12,7 @@
 union in_addr_union {
         struct in_addr in;
         struct in6_addr in6;
+        uint8_t bytes[CONST_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
 };
 
 struct in_addr_data {