Hi, thanks for the reply of the patch and all the hints. I changed some parts as you suggested and here some notes to your questions.
if (!(my_skb_push(frag_skb, hdr_len) >= 0 &&
my_skb_push(skb, hdr_len) >= 0)) {
Didn't you wanted to check if one of the my_skb_push failed and not if both failed?
This part check if one failed, but you are right if you think that it looks too complicated. I changed it because it is easy to misunderstand this expression.
Can you please explain why the copyright already starts in 2007?
Copy and paste failure, changed it to 2010.
if (atomic_read(&batman_if->frag_seqno) == FRAG_MAX_SEQ)
atomic_set(&batman_if->frag_seqno, 0);
It is not a good idea to split two atomic_ operations which depends on each other.
I removed that part completely, because there is a simplier way.
And now some words to the implementation. This version of fragmentation handles only packets over a batX interface. My test setup follows:
laptop tap0 --> br0 (bat0/eth0) host1 eth1 ------> eth0 host2 -----> eth0 host3
ping -s 1472 -M do xxx
1472 bytes - data 28 bytes - icmp / ip 14 bytes - eth
Bat0 receives 1514 bytes (interface_tx, data_len), if data_len + unicast_packet is larger than the mtu of the sending interface, this packet will be fragmented.
In fragmentation 2.0 i would like to implement a solution for the problem described by simon ( i hope i understood him correctly). A node has two batman interfaces and the mtu of interface2 is smaller then interface1. In case a packet from iface1 (with the size of this mtu) travels to iface2, we currently have a problem. Version 2.0 will fix this.
regards, andreas