diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-04-24 07:51:16 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-04-24 11:13:40 +0200 |
commit | ae3c6891596950ac7c2d5c45a078ab51efc53d99 (patch) | |
tree | 2810c19d70469012754091d855586f8087ac8fcf /interface-ip.c | |
parent | 372fa0f3f867eee4b949727aa5c2e4fa9e728d55 (diff) |
netifd: Set prefix assignment enabled if the prefix adress can be installed
No need to install policy routes if the prefix address cannot be installed; clean up of the policy routes
and the prefix address only needs to happen when the prefix assignment was active.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface-ip.c')
-rw-r--r-- | interface-ip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/interface-ip.c b/interface-ip.c index 6f42015..b000725 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -661,8 +661,8 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment, } assignment->enabled = false; - } else if (add && (iface->state == IFS_UP || iface->state == IFS_SETUP)) { - system_add_address(l3_downlink, &addr); + } else if (add && (iface->state == IFS_UP || iface->state == IFS_SETUP) && + !system_add_address(l3_downlink, &addr)) { if (prefix->iface && !assignment->enabled) { set_ip_source_policy(true, true, IPRULE_PRIORITY_REJECT, &addr.addr, addr.mask, 0, iface, "unreachable"); |