summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-12-08 00:32:36 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-12-18 16:32:31 +0100
commitde697db05b08464180af4a257f6df88b00d60b9e (patch)
treefb4221470d409a2e09e4c123239817b565495da7 /src/network/networkd-address.c
parent0c8e33b6e9bb0f15eeaec8162fb58b07d403e22e (diff)
downloadsystemd-de697db05b08464180af4a257f6df88b00d60b9e.tar.gz
network: introduce AddPrefixRoute= and deprecate PrefixRoute=
PrefixRoute= was added by e63be0847c39bfdca45c25c505922814374581a7, but unfortunately, the meaning of PrefixRoute= is inverted; when true IFA_F_NOPREFIXROUTE flag is added. This introduces AddPrefixRoute= setting.
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 886a8c0665..169d0e4829 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -33,6 +33,7 @@ int address_new(Address **ret) {
.cinfo.ifa_prefered = CACHE_INFO_INFINITY_LIFE_TIME,
.cinfo.ifa_valid = CACHE_INFO_INFINITY_LIFE_TIME,
.duplicate_address_detection = ADDRESS_FAMILY_IPV6,
+ .prefix_route = true,
};
*ret = TAKE_PTR(address);
@@ -596,7 +597,7 @@ int address_configure(
if (address->manage_temporary_address)
address->flags |= IFA_F_MANAGETEMPADDR;
- if (address->prefix_route)
+ if (!address->prefix_route)
address->flags |= IFA_F_NOPREFIXROUTE;
if (address->autojoin)
@@ -1001,6 +1002,8 @@ int config_parse_address_flags(const char *unit,
else if (streq(lvalue, "ManageTemporaryAddress"))
n->manage_temporary_address = r;
else if (streq(lvalue, "PrefixRoute"))
+ n->prefix_route = !r;
+ else if (streq(lvalue, "AddPrefixRoute"))
n->prefix_route = r;
else if (streq(lvalue, "AutoJoin"))
n->autojoin = r;