From f097f90c7043f04e3fbb5851bdecfe6fdf9b9769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 30 Aug 2010 14:58:08 +0000 Subject: [PATCH] * Fixed a bug in deciding whether or not an IP level broadcast should be accepted. This should have been the reason for Duggan's problem with DHCP as part of bug #6454. * Stippi's router seems to answer DHCP requests with broadcasts to the future broadcast IP address. Luckily, it's also a link layer broadcast, so we let the upper protocols decide what to do with it, depending on that; this could also be done depending on the existence of any unconfigured networks. * This should fix Stippi's DHCP problems, and therefore bug #6454 - in any case, this will be the last try before my vacation :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38450 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp index 93e27d35db..db79f94cb1 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp @@ -1604,7 +1604,7 @@ ipv4_receive_data(net_buffer* buffer) // Find first interface with a matching family if (!sDatalinkModule->is_local_link_address(sDomain, true, buffer->destination, &buffer->interface_address)) - notForUs = wasMulticast; + notForUs = !wasMulticast; } else if (IN_MULTICAST(ntohl(header.destination))) { buffer->flags |= MSG_MCAST; } else { @@ -1615,7 +1615,12 @@ ipv4_receive_data(net_buffer* buffer) &buffer->interface_address, &matchedAddressType) && !sDatalinkModule->is_local_link_address(sDomain, true, buffer->destination, &buffer->interface_address)) { - notForUs = true; + // if the buffer was a link layer multicast, regard it as a + // broadcast, and let the upper levels decide what to do with it + if (wasMulticast) + buffer->flags |= MSG_BCAST; + else + notForUs = true; } else { // copy over special address types (MSG_BCAST or MSG_MCAST): buffer->flags |= matchedAddressType;