Current-Users archive

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

Re: dhcpd build break



> --- dhcp6.c     21 Jun 2013 19:33:08 -0000      1.1.1.1
> +++ dhcp6.c     22 Jun 2013 02:28:35 -0000
> @@ -638,7 +638,8 @@ 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;
> +                       o->len = htons(o->len);
>                  }
> 
>                  if (n_options) {
> 
> I get a successful "build.sh release".

For readability, it's better to use an explicit temporary variable,
to keep o->len in the target byteorder:
---
                        len_tmp = encode_rfc1035(hostname, p + 1);
                        if (len_tmp == 0)
                                *p = 0x04;
                        o->len = htons(len_tmp + 1);
---

BTW, a magic "0x04" seems also awful for readers...

---
Izumi Tsustui


Home | Main Index | Thread Index | Old Index