diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-21 14:43:52 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-21 15:41:39 +0100 |
commit | b0769168ccdc25a94e691540737b72914fef7784 (patch) | |
tree | fd1652f3659a9f3c6c8187016cceb98804e92d1f /src/router.c | |
parent | e4a24dcb5aa48fdace3d6482db262bde9969b5bb (diff) |
dhcpv6/router: add support for mutiple master interfaces
Support multiple master interfaces for dhcpv6 and ra; it allows
to forward dhcpv6 mesaages and RS on multiple upstream links
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/router.c')
-rw-r--r-- | src/router.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/router.c b/src/router.c index ec0bee0..976e28a 100644 --- a/src/router.c +++ b/src/router.c @@ -712,10 +712,17 @@ static void handle_icmpv6(void *addr, void *data, size_t len, if (hdr->icmp6_type == ND_ROUTER_SOLICIT) send_router_advert(iface, &from->sin6_addr); } else if (iface->ra == MODE_RELAY) { /* Relay mode */ - if (hdr->icmp6_type == ND_ROUTER_ADVERT && iface->master) + if (hdr->icmp6_type == ND_ROUTER_SOLICIT && !iface->master) { + struct interface *c; + + avl_for_each_element(&interfaces, c, avl) { + if (!c->master || c->ra != MODE_RELAY) + continue; + + forward_router_solicitation(c); + } + } else if (hdr->icmp6_type == ND_ROUTER_ADVERT && iface->master) forward_router_advertisement(iface, data, len); - else if (hdr->icmp6_type == ND_ROUTER_SOLICIT && !iface->master) - forward_router_solicitation(odhcpd_get_master_interface()); } } |