Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dhcpd build break



On 22/06/2013 2:35, Paul Goyette wrote:
The code in question, on my machine, says

                        o->len = encode_rfc1035(hostname, p + 1);
                        if (o->len == 0)
                                *p = 0x04;
                   o->len = htons(++o->len);
                }


Hmmm, could be my import code that inserts RCISD macros affected my line numbers :)

I don't know where htons() is defined, but I suspect that you might
be evaluating the argument twice, so ++o->len is a bad thing!

You might try splitting into two lines

                        o->len++;
                        o->len = htons(o->len);

This should work equally well?

diff --git a/dhcp6.c b/dhcp6.c
index 205fce2..8c01a45 100644
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -635,7 +635,7 @@ dhcp6_makemessage(struct interface *ifp)
                        o->len = encode_rfc1035(hostname, p + 1);
                        if (o->len == 0)
                                *p = 0x04;
-                       o->len = htons(++o->len);
+                       o->len = htons((++o->len));
                }

                if (n_options) {

Any more breaks or is that it for BE ports?

Roy


Home | Main Index | Thread Index | Old Index