Use server and client IP from the bootp packet.
This commit is contained in:
parent
818a356eb1
commit
11d1ea5df6
1 changed files with 8 additions and 6 deletions
14
net/ip.c
14
net/ip.c
|
@ -72,7 +72,9 @@ recv_ip_packet (struct grub_net_network_layer_interface *inf,
|
||||||
{
|
{
|
||||||
trans_net_inf->inner_layer->link_prot->recv(inf,trans_net_inf->inner_layer,nb);
|
trans_net_inf->inner_layer->link_prot->recv(inf,trans_net_inf->inner_layer,nb);
|
||||||
iph = (struct iphdr *) nb->data;
|
iph = (struct iphdr *) nb->data;
|
||||||
if (iph->dest == 0x0908eaaa && iph->src == 0x0908ea92 && iph->protocol == 0x11)
|
if (iph->protocol == 0x11 &&
|
||||||
|
iph->dest == (grub_uint32_t) bootp_pckt -> yiaddr &&
|
||||||
|
iph->src == (grub_uint32_t) bootp_pckt -> siaddr )
|
||||||
{
|
{
|
||||||
grub_netbuff_pull(nb,sizeof(*iph));
|
grub_netbuff_pull(nb,sizeof(*iph));
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -82,11 +84,11 @@ recv_ip_packet (struct grub_net_network_layer_interface *inf,
|
||||||
if (current_time - start_time > TIMEOUT_TIME_MS)
|
if (current_time - start_time > TIMEOUT_TIME_MS)
|
||||||
return grub_error (GRUB_ERR_TIMEOUT, "Time out.");
|
return grub_error (GRUB_ERR_TIMEOUT, "Time out.");
|
||||||
}
|
}
|
||||||
/* grub_printf("ip.src 0x%x\n",iph->src);
|
// grub_printf("ip.src 0x%x\n",iph->src);
|
||||||
grub_printf("ip.dst 0x%x\n",iph->dest);
|
// grub_printf("ip.dst 0x%x\n",iph->dest);
|
||||||
grub_printf("ip.len 0x%x\n",iph->len);
|
// grub_printf("ip.len 0x%x\n",iph->len);
|
||||||
grub_printf("ip.protocol 0x%x\n",iph->protocol);
|
// grub_printf("ip.protocol 0x%x\n",iph->protocol);
|
||||||
*/
|
|
||||||
/* - get ip header
|
/* - get ip header
|
||||||
- verify if is the next layer is correct
|
- verify if is the next layer is correct
|
||||||
-*/
|
-*/
|
||||||
|
|
Loading…
Reference in a new issue