715 | | call->vend[len++] = DHCP_HOST; |
716 | | call->vend[len++] = strlen (hostname); |
717 | | strcpy ((char*) &call->vend[len], hostname); |
718 | | len += strlen (hostname); |
| 715 | /* RFC 2132 Section 3.14. dictates min length for this option is 1 char. |
| 716 | If hostname is zero-length, then let's just not add it */ |
| 717 | |
| 718 | int hostnamelen = strlen(hostname); |
| 719 | |
| 720 | if( (hostnamelen > 0) && (hostnamelen < 256) ) |
| 721 | { |
| 722 | call->vend[len++] = DHCP_HOST; |
| 723 | call->vend[len++] = (uint8_t) hostnamelen; |
| 724 | strcpy ((char*) &call->vend[len], hostname); |
| 725 | len += hostnamelen; |
| 726 | } |