search for: padding_len

Displaying 3 results from an estimated 3 matches for "padding_len".

2012 May 22
0
[klibc:master] ipconfig: Append padding if DHCP packet length < 300 octets
...e */ /* [6] = {dhcp_end, sizeof(dhcp_end)} */ + /* [7] = optional padding */ }; /* @@ -187,7 +189,10 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) { struct bootp_hdr bootp; char dhcp_hostname[SYS_NMLN+2]; + uint8_t padding[BOOTP_MIN_LEN - sizeof(struct bootp_hdr)]; + int padding_len; int i = 4; + int j; memset(&bootp, 0, sizeof(struct bootp_hdr)); @@ -232,6 +237,17 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) vec[i].iov_base = dhcp_end; vec[i].iov_len = sizeof(dhcp_end); + /* Append padding if DHCP packet length is shorter than BOOTP_MIN_LE...
2010 Mar 11
2
[PATCH FOR DISCUSSION ONLY] Rewrite libguestfs-supermin-helper in C.
...t_dev), minor (statbuf->st_dev), + major (statbuf->st_rdev), minor (statbuf->st_rdev), + (unsigned) len, 0); + + /* Write the header. */ + copy_to_fd (header, CPIO_HEADER_LEN); + + /* Follow with the filename, and pad it. */ + copy_to_fd (filename, len); + size_t padding_len = PADDING (CPIO_HEADER_LEN + len); + copy_padding (padding_len); + + /* Follow with the file or symlink content, and pad it. */ + if (has_body) { + if (S_ISREG (statbuf->st_mode)) + copy_file_len_to_fd (orig_filename, statbuf->st_size); + else if (S_ISLNK (statbuf->st_mode))...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...dev), minor (statbuf->st_dev), - major (statbuf->st_rdev), minor (statbuf->st_rdev), - (unsigned) len, 0); - - /* Write the header. */ - write_to_fd (header, CPIO_HEADER_LEN); - - /* Follow with the filename, and pad it. */ - write_to_fd (filename, len); - size_t padding_len = PADDING (CPIO_HEADER_LEN + len); - write_padding (padding_len); - - /* Follow with the file or symlink content, and pad it. */ - if (has_body) { - if (S_ISREG (statbuf->st_mode)) - write_file_len_to_fd (orig_filename, statbuf->st_size); - else if (S_ISLNK (statbuf->st_mode)...