Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
microudp: fix udp txlen
* the preample length 8 is already included in sizeof(struct
ethernet_header)
* the minimum packet size is 64, exluding fcs and including
preample it is 68 (the arp functions are correct)
  • Loading branch information
jordens authored and Sebastien Bourdeauducq committed Nov 12, 2013
1 parent 69568ad commit 1a28690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/libnet/microudp.c
Expand Up @@ -262,8 +262,8 @@ int microudp_send(unsigned short src_port, unsigned short dst_port, unsigned int
&& (cached_mac[3] == 0) && (cached_mac[4] == 0) && (cached_mac[5] == 0))
return 0;

txlen = length + sizeof(struct ethernet_header) + sizeof(struct udp_frame) + 8;
if(txlen < 72) txlen = 72;
txlen = length + sizeof(struct ethernet_header) + sizeof(struct udp_frame);
if(txlen < 68) txlen = 68;

fill_eth_header(&txbuffer->frame.eth_header,
cached_mac,
Expand Down

0 comments on commit 1a28690

Please sign in to comment.