163 |
|
{ |
164 |
|
#if SUPPORTS_UDP_TUNNEL |
165 |
|
if (udp_tunnel_active) { |
166 |
< |
uint8 packet[1514]; |
166 |
> |
EthernetPacket ether_packet; |
167 |
> |
uint32 packet = ether_packet.addr(); |
168 |
|
ssize_t length; |
169 |
|
|
170 |
|
// Read packets from socket and hand to ether_udp_read() for processing |
171 |
|
while (true) { |
172 |
|
struct sockaddr_in from; |
173 |
|
socklen_t from_len = sizeof(from); |
174 |
< |
length = recvfrom(fd, packet, 1514, 0, (struct sockaddr *)&from, &from_len); |
174 |
> |
length = recvfrom(fd, Mac2HostAddr(packet), 1514, 0, (struct sockaddr *)&from, &from_len); |
175 |
|
if (length < 14) |
176 |
|
break; |
177 |
|
ether_udp_read(packet, length, &from); |