mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Handle outgoing DHCP server messages correctly
This commit is contained in:
1 parent
dd0ecc5438
commit
e9171d7d22
1 file changed
+6
@@ -106,6 +106,7 @@ struct ethip_hdr {
|
||||
u16_t ipchksum;
|
||||
u16_t srcipaddr[2],
|
||||
destipaddr[2];
|
||||
u16_t sport, dport;
|
||||
};
|
||||
|
||||
#define ARP_REQUEST 1
|
||||
@@ -370,6 +371,11 @@ uip_arp_out(void) __banked
|
||||
If not ARP table entry is found, we overwrite the original IP
|
||||
packet with an ARP request for the IP address. */
|
||||
|
||||
if (IPBUF->sport == 0x4300 && !IPBUF->destipaddr[0] && !IPBUF->destipaddr[1]) {
|
||||
IPBUF->destipaddr[0] = 0xffff;
|
||||
IPBUF->destipaddr[1] = 0xffff;
|
||||
IPBUF->dport = 0x4400;
|
||||
}
|
||||
/* First check if destination is a local broadcast. */
|
||||
if(uip_ipaddr_cmpc(IPBUF->destipaddr, broadcast_ipaddr)) {
|
||||
memcpyc(IPBUF->ethhdr.dest.addr, broadcast_ethaddr.addr, 6);
|
||||
|
||||
Reference in new issue
Block a user