pull/19/merge
tethistlethwaite 4 years ago committed by GitHub
commit 7f83817d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      SnailNet/Dhcp.HC
  2. 5
      SnailNet/IPv4.HC

@ -242,7 +242,7 @@ I64 DhcpParseOffer(U32 xid, U8* data, I64 length, U32* yiaddr_out,
//"DhcpParseOffer: end %d %d %d %d\n", have_type, have_dns, have_subnet, have_router;
if (have_type && have_dns && have_subnet && have_router) {
if (have_type && have_subnet) {
*yiaddr_out = ntohl(hdr->yiaddr);
return 0;
}

@ -86,6 +86,11 @@ static I64 GetEthernetAddressForIP(U32 ip, U8** mac_out) {
}
// outside this subnet; needs routing
else if ((ip & ipv4_subnet_mask) != (my_ip & ipv4_subnet_mask)) {
// no gateway
if (ipv4_router_addr == 0) {
return IPV4_EADDR_INVALID;
}
// FIXME: infinite loop if mis-configured
return GetEthernetAddressForIP(ipv4_router_addr, mac_out);

Loading…
Cancel
Save