File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ namespace net
206206 dhcp->hops = 0 ;
207207 dhcp->xid = htonl (this ->xid );
208208 dhcp->secs = 0 ;
209- dhcp->flags = htons (BOOTP_UNICAST );
209+ dhcp->flags = htons (BOOTP_BROADCAST );
210210 dhcp->ciaddr = IP4::INADDR_ANY;
211211 dhcp->yiaddr = IP4::INADDR_ANY;
212212 dhcp->siaddr = IP4::INADDR_ANY;
@@ -374,7 +374,7 @@ namespace net
374374 resp->hops = 0 ;
375375 resp->xid = htonl (this ->xid );
376376 resp->secs = 0 ;
377- resp->flags = htons (BOOTP_UNICAST );
377+ resp->flags = htons (BOOTP_BROADCAST );
378378
379379 resp->ciaddr = IP4::INADDR_ANY;
380380 resp->yiaddr = IP4::INADDR_ANY;
Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ namespace net {
4848 auto data = pckt->buffer ();
4949 ip_header* hdr = &reinterpret_cast <full_header*>(data)->ip_hdr ;
5050
51- // Drop if my ip address doesn't match destination ip address
52- if (UNLIKELY (local_ip () != hdr->daddr )) {
51+ // Drop if my ip address doesn't match destination ip address or broadcast
52+ if (UNLIKELY (hdr->daddr != local_ip () and
53+ hdr->daddr != INADDR_BCAST)) {
5354 packets_dropped_++;
5455 return ;
5556 }
You can’t perform that action at this time.
0 commit comments