router: don't leak RA message in relay mode (FS#1853)
authorHans Dedecker <dedeckeh@gmail.com>
Sun, 23 Sep 2018 17:06:08 +0000 (19:06 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Sun, 23 Sep 2018 18:21:07 +0000 (20:21 +0200)
In relay mode don't send RA message with router lifetime equal to 0 when
interface gets disabled as router

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/router.c

index 8e3013c1fb6b41f7ea5c8ca295b779d251d89a9f..70f946280d55edbe40099e02b33a6c102c813340 100644 (file)
@@ -172,7 +172,7 @@ int router_setup_interface(struct interface *iface, bool enable)
                        &mreq, sizeof(mreq));
 
        if (!enable) {
-               if (iface->ra)
+               if (iface->ra == MODE_SERVER || (iface->ra == MODE_RELAY && !iface->master))
                        trigger_router_advert(&iface->timer_rs);
        } else {
                if (iface->ra == MODE_RELAY && iface->master) {