-- 
Robert Jordens.
From d6cbaa81af484de79c3382199affab6a1e3f0ef2 Mon Sep 17 00:00:00 2001
From: Robert Jordens <[email protected]>
Date: Mon, 11 Nov 2013 15:45:45 -0700
Subject: [PATCH] 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)
---
 software/libnet/microudp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/software/libnet/microudp.c b/software/libnet/microudp.c
index 31bb5aa..d499d63 100644
--- a/software/libnet/microudp.c
+++ b/software/libnet/microudp.c
@@ -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,
-- 
1.8.3.2

_______________________________________________
Devel mailing list
[email protected]
https://ssl.serverraum.org/lists/listinfo/devel

Reply via email to