diff options
author | Tom Gundersen <teg@jklm.no> | 2014-01-28 20:00:47 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-01-30 14:30:39 +0100 |
commit | 801bd9e859d7f3f127617172910786929776472b (patch) | |
tree | 5c0d67fdf25bb222bcbdc977db96a7fc1e1e21d9 /src/network/networkd-address.c | |
parent | eb27aeca247a4cf8816fffc4c0dbcab55ead3864 (diff) |
net-util: verify the address family
Error out if the address family is already set to something incompatible with the
address being parsed.
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r-- | src/network/networkd-address.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 3f787948f9..de5566dfdb 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -46,6 +46,8 @@ int address_new_static(Network *network, unsigned section, Address **ret) { if (!address) return -ENOMEM; + address->family = AF_UNSPEC; + address->network = network; LIST_PREPEND(static_addresses, network->static_addresses, address); @@ -68,6 +70,8 @@ int address_new_dynamic(Address **ret) { if (!address) return -ENOMEM; + address->family = AF_UNSPEC; + *ret = address; address = NULL; |