summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-18 06:05:31 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-06-07 23:33:27 +0200
commit4c0c8d1e72f73576df54fa97011e1945638cec77 (patch)
treee038d0d2271d1566a6eb59efa9ba5f9be24a66af
parentnetwork: address label: refuse IPv4 mapped address with large prefix length (diff)
downloadsystemd-4c0c8d1e72f73576df54fa97011e1945638cec77.tar.xz
systemd-4c0c8d1e72f73576df54fa97011e1945638cec77.zip
network: address label: use struct in6_addr instead
Address label is for IPv6.
-rw-r--r--src/network/networkd-address-label.c4
-rw-r--r--src/network/networkd-address-label.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c
index c697a55fb2..cf99473cf8 100644
--- a/src/network/networkd-address-label.c
+++ b/src/network/networkd-address-label.c
@@ -113,7 +113,7 @@ static int address_label_configure(AddressLabel *label, Link *link) {
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFAL_LABEL attribute: %m");
- r = sd_netlink_message_append_in6_addr(req, IFA_ADDRESS, &label->in_addr.in6);
+ r = sd_netlink_message_append_in6_addr(req, IFA_ADDRESS, &label->in_addr);
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFA_ADDRESS attribute: %m");
@@ -197,7 +197,7 @@ int config_parse_address_label_prefix(const char *unit,
return 0;
}
- n->in_addr = a;
+ n->in_addr = a.in6;
n->prefixlen = prefixlen;
TAKE_PTR(n);
diff --git a/src/network/networkd-address-label.h b/src/network/networkd-address-label.h
index 11fdd9abfe..5a93de4dfc 100644
--- a/src/network/networkd-address-label.h
+++ b/src/network/networkd-address-label.h
@@ -16,7 +16,7 @@ typedef struct AddressLabel {
unsigned char prefixlen;
uint32_t label;
- union in_addr_union in_addr;
+ struct in6_addr in_addr;
} AddressLabel;
AddressLabel *address_label_free(AddressLabel *label);