Lines 94-104
Link Here
|
94 |
memcpy (&packet->dhcp, data, sizeof (dhcpmessage_t)); |
94 |
memcpy (&packet->dhcp, data, sizeof (dhcpmessage_t)); |
95 |
|
95 |
|
96 |
ip->ip_p = IPPROTO_UDP; |
96 |
ip->ip_p = IPPROTO_UDP; |
97 |
ip->ip_src.s_addr = htonl (source.s_addr); |
97 |
ip->ip_src.s_addr = source.s_addr; |
98 |
if (dest.s_addr == 0) |
98 |
if (dest.s_addr == 0) |
99 |
ip->ip_dst.s_addr = htonl (INADDR_BROADCAST); |
99 |
ip->ip_dst.s_addr = htonl (INADDR_BROADCAST); |
100 |
else |
100 |
else |
101 |
ip->ip_dst.s_addr = htonl (dest.s_addr); |
101 |
ip->ip_dst.s_addr = dest.s_addr; |
102 |
|
102 |
|
103 |
udp->uh_sport = htons (DHCP_CLIENT_PORT); |
103 |
udp->uh_sport = htons (DHCP_CLIENT_PORT); |
104 |
udp->uh_dport = htons (DHCP_SERVER_PORT); |
104 |
udp->uh_dport = htons (DHCP_SERVER_PORT); |