]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/dnsmasq/0107-Extend-bridge-interface-aliasing-to-DHCPv6.patch
8ae75d356354a992ea8ae68c7dda62190761ae9a
[people/pmueller/ipfire-2.x.git] / src / patches / dnsmasq / 0107-Extend-bridge-interface-aliasing-to-DHCPv6.patch
1 From 0ddb8769bb809cd118840553e12be86297cdf246 Mon Sep 17 00:00:00 2001
2 From: Neil Jerram <Neil.Jerram@metaswitch.com>
3 Date: Wed, 10 Jun 2015 22:11:06 +0100
4 Subject: [PATCH 107/113] Extend --bridge-interface aliasing to DHCPv6.
5
6 ---
7 src/dhcp6.c | 28 +++++++++++++++++++++++++++-
8 1 file changed, 27 insertions(+), 1 deletion(-)
9
10 diff --git a/src/dhcp6.c b/src/dhcp6.c
11 index ee2aa5d3bf3c..4c60c6e86c0c 100644
12 --- a/src/dhcp6.c
13 +++ b/src/dhcp6.c
14 @@ -144,6 +144,8 @@ void dhcp6_packet(time_t now)
15
16 if ((port = relay_reply6(&from, sz, ifr.ifr_name)) == 0)
17 {
18 + struct dhcp_bridge *bridge, *alias;
19 +
20 for (tmp = daemon->if_except; tmp; tmp = tmp->next)
21 if (tmp->name && wildcard_match(tmp->name, ifr.ifr_name))
22 return;
23 @@ -160,6 +162,30 @@ void dhcp6_packet(time_t now)
24 memset(&parm.fallback, 0, IN6ADDRSZ);
25 memset(&parm.ll_addr, 0, IN6ADDRSZ);
26 memset(&parm.ula_addr, 0, IN6ADDRSZ);
27 +
28 + /* If the interface on which the DHCPv6 request was received is
29 + an alias of some other interface (as specified by the
30 + --bridge-interfaces option), change parm.ind so that we look
31 + for DHCPv6 contexts associated with the aliased interface
32 + instead of with the aliasing one. */
33 + for (bridge = daemon->bridges; bridge; bridge = bridge->next)
34 + {
35 + for (alias = bridge->alias; alias; alias = alias->next)
36 + if (wildcard_matchn(alias->iface, ifr.ifr_name, IF_NAMESIZE))
37 + {
38 + parm.ind = if_nametoindex(bridge->iface);
39 + if (!parm.ind)
40 + {
41 + my_syslog(MS_DHCP | LOG_WARNING,
42 + _("unknown interface %s in bridge-interface"),
43 + bridge->iface);
44 + return;
45 + }
46 + break;
47 + }
48 + if (alias)
49 + break;
50 + }
51
52 for (context = daemon->dhcp6; context; context = context->next)
53 if (IN6_IS_ADDR_UNSPECIFIED(&context->start6) && context->prefix == 0)
54 @@ -208,7 +234,7 @@ void dhcp6_packet(time_t now)
55 /* May have configured relay, but not DHCP server */
56 if (!daemon->doing_dhcp6)
57 return;
58 -
59 +
60 lease_prune(NULL, now); /* lose any expired leases */
61
62 port = dhcp6_reply(parm.current, if_index, ifr.ifr_name, &parm.fallback,
63 --
64 2.1.0
65