diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-01-02 17:13:09 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-01-02 17:13:33 +0100 |
commit | 11ce6b5f0eaa9eac8cfcb77a89829275ebf04f96 (patch) | |
tree | 825204a4e450288994cdafca48aec354a0ff527e /src/dhcpv6-ia.c | |
parent | 561890e1ce8aa467a83db5f05e563a00d4d9aa47 (diff) |
dhcpv6-ia: coding style fixes
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6-ia.c')
-rw-r--r-- | src/dhcpv6-ia.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index c8786c3..abcbe89 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -50,6 +50,7 @@ int setup_dhcpv6_ia_interface(struct interface *iface, bool enable) { if (!enable && iface->ia_assignments.next) { struct dhcpv6_assignment *c; + while (!list_empty(&iface->ia_assignments)) { c = list_first_entry(&iface->ia_assignments, struct dhcpv6_assignment, head); free_dhcpv6_assignment(c); @@ -103,7 +104,7 @@ int setup_dhcpv6_ia_interface(struct interface *iface, bool enable) /* Infinite valid */ a->valid_until = 0; - // Assign to all interfaces + /* Assign to all interfaces */ struct dhcpv6_assignment *c; list_for_each_entry(c, &iface->ia_assignments, head) { if (c->length != 128 || c->assigned > a->assigned) { @@ -259,7 +260,7 @@ void dhcpv6_write_statefile(void) char duidbuf[264]; odhcpd_hexlify(duidbuf, c->clid_data, c->clid_len); - // iface DUID iaid hostname lifetime assigned length [addrs...] + /* iface DUID iaid hostname lifetime assigned length [addrs...] */ int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s %x %s %ld %x %u ", iface->ifname, duidbuf, ntohl(c->iaid), (c->hostname ? c->hostname : "-"), @@ -319,7 +320,7 @@ void dhcpv6_write_statefile(void) char duidbuf[16]; odhcpd_hexlify(duidbuf, c->hwaddr, sizeof(c->hwaddr)); - // iface DUID iaid hostname lifetime assigned length [addrs...] + /* iface DUID iaid hostname lifetime assigned length [addrs...] */ int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s ipv4 %s %ld %x 32 ", iface->ifname, duidbuf, (c->hostname ? c->hostname : "-"), @@ -384,7 +385,7 @@ static void apply_lease(struct interface *iface, struct dhcpv6_assignment *a, bo } } -// More data was received from TCP connection +/* More data was received from TCP connection */ static void managed_handle_pd_data(struct ustream *s, _unused int bytes_new) { struct dhcpv6_assignment *c = container_of(s, struct dhcpv6_assignment, managed_sock); @@ -1037,7 +1038,7 @@ ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface, list_for_each_entry(c, &iface->ia_assignments, head) { if (((c->clid_len == clid_len && !memcmp(c->clid_data, clid_data, clid_len)) || (c->clid_len >= clid_len && !c->clid_data[0] && !c->clid_data[1] - && !memcmp(c->mac, mac, sizeof(mac)))) && + && !memcmp(c->mac, mac, sizeof(mac)))) && (c->iaid == ia->iaid || INFINITE_VALID(c->valid_until) || now < c->valid_until) && ((is_pd && c->length <= 64) || (is_na && c->length == 128))) { a = c; |