[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv3 2/3] v8.2 add support for DHCPv6



On 12/04/2012 03:03 PM, Laine Stump wrote:
diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
>index 4f210d2..8f26d42 100644
>--- a/src/util/dnsmasq.c
>+++ b/src/util/dnsmasq.c
>@@ -306,7 +306,14 @@ hostsfileAdd(dnsmasqHostsfile *hostsfile,
>      if (!(ipstr = virSocketAddrFormat(ip)))
>          return -1;
> >- if (name) {
>+    /* the first test determins if it is a dhcpv6 host */
s/determins/determines/


And is that actually true? I thought you could have ipv4 static hosts
based on name as well.
You should instead check the FAMILY of the address that is passed in.


>+    if (mac==NULL) {
>+        if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,[%s]",
>+                        name, ipstr) < 0) {
>+            goto alloc_error;
>+        }
>+    }
>+    else if (name) {
>          if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s,%s",
Hmm, but according to this just giving name and IP for IPv4 would blow
up in your face...

Can you ask about this on dnsmasq list (or verify in the code)? If
name+ip-only is allowed for IPv4, we need to change the hostsfileAdd
function, and if not, we need to change the parse to always require a
mac address for ipv4 (currently it requires either name or ip but not both).


You caught a good one here. The code in src/conf/network.c is correct and supports only name and Address for IPv6 as well as name+mac+ip or name+ip or mac+ip for IPv4. The code in dnsmasq.c did not but does now. There are a whole bunch of variations supported by dnsmasq but I am not sure how many other are worth any effort.

One thing (I hope this is not a show stopper). In the spirit of "what's done is done," I "ignored" your comments about --domain-needed moving and "--except-interface", "lo" changing to "--except-interface=lo" because it would mean changing many test files as well as many changes to the conf-file patch file.

v8.3 of DHCPv6 done ... moving on to conf-file.

Gene


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]