From: florian Date: Tue, 30 May 2017 15:57:12 +0000 (+0000) Subject: delete default route from FIB when we receive advertisement with X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=73e1af33289d47dde43f4233498eeff6b92a6742;p=openbsd delete default route from FIB when we receive advertisement with router lifetime of 0 --- diff --git a/usr.sbin/slaacd/engine.c b/usr.sbin/slaacd/engine.c index edc848da98d..6aa7ba83064 100644 --- a/usr.sbin/slaacd/engine.c +++ b/usr.sbin/slaacd/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.33 2017/05/30 15:39:49 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.34 2017/05/30 15:57:12 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser @@ -1472,7 +1472,7 @@ void update_iface_ra(struct slaacd_iface *iface, struct radv *ra) struct radv *old_ra; struct radv_prefix *prefix; struct address_proposal *addr_proposal; - struct dfr_proposal *dfr_proposal; + struct dfr_proposal *dfr_proposal, *tmp; int found, found_privacy; char hbuf[NI_MAXHOST]; @@ -1483,7 +1483,17 @@ void update_iface_ra(struct slaacd_iface *iface, struct radv *ra) free_ra(old_ra); } if (ra->router_lifetime == 0) { - /* XXX expire default route */ + LIST_FOREACH_SAFE(dfr_proposal, &iface->dfr_proposals, entries, + tmp) { + if (memcmp(&dfr_proposal->addr, + &ra->from, sizeof(struct sockaddr_in6)) == + 0) { + LIST_REMOVE(dfr_proposal, entries); + evtimer_del(&dfr_proposal->timer); + withdraw_dfr(dfr_proposal); + free(dfr_proposal); + } + } } else { found = 0; LIST_FOREACH(dfr_proposal, &iface->dfr_proposals, entries) {