Trivial cosmetic corrections.

This commit is contained in:
Nicholas J. Kain 2011-06-26 17:37:57 -04:00
parent 864ad73b20
commit 0581cc9aed
2 changed files with 3 additions and 2 deletions

View File

@ -277,7 +277,7 @@ size_t add_option_string(uint8_t *optbuf, size_t buflen, uint8_t *optstr)
} }
/* end position + optstr length + option code/length + end option */ /* end position + optstr length + option code/length + end option */
if (end + datalen + 2 + 1 >= buflen) { if (end + datalen + 2 + 1 >= buflen) {
log_warning("Option 0x%02x did not fit into the packet!", optstr[0]); log_warning("add_option_string: No space for option 0x%02x", optstr[0]);
return 0; return 0;
} }
memcpy(optbuf + end, optstr, datalen + 2); memcpy(optbuf + end, optstr, datalen + 2);

View File

@ -182,6 +182,7 @@ out_fd:
out: out:
return -1; return -1;
} }
// Read a packet from a cooked socket. Returns -1 on fatal error, -2 on // Read a packet from a cooked socket. Returns -1 on fatal error, -2 on
// transient error. // transient error.
static int get_packet(struct dhcpmsg *packet, int fd) static int get_packet(struct dhcpmsg *packet, int fd)
@ -214,7 +215,7 @@ static inline uint16_t foldcarry(uint32_t v)
} }
// This function is not suitable for summing buffers that are greater than // This function is not suitable for summing buffers that are greater than
// 128k-1 bytes in length: failure case will be incorrect checksums via // 128k bytes in length: failure case will be incorrect checksums via
// unsigned overflow, which is a defined operation and is safe. This limit // unsigned overflow, which is a defined operation and is safe. This limit
// should not be an issue for IPv4 or IPv6 packet, which are limited to // should not be an issue for IPv4 or IPv6 packet, which are limited to
// at most 64k bytes. // at most 64k bytes.