diff options
author | Martin Hundebøll <martin@hundeboll.net> | 2013-01-25 05:12:42 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-03-13 17:53:50 -0400 |
commit | 612d2b4fe0a1ff2f8389462a6f8be34e54124c05 (patch) | |
tree | 033dc44cbb8a68965e2eb0b7e5039a46ed845a52 /net/batman-adv/send.c | |
parent | 3c12de9a5c756b23fe7c9ab332474ece1568914c (diff) |
batman-adv: network coding - save overheard and tx packets for decoding
To be able to decode a network coded packet, a node must already know
one of the two coded packets. This is done by buffering skbs before
transmission and buffering packets sniffed with promiscuous mode from
other hosts.
Packets are kept in a buffer similar to the one with forward-skbs: A
hash table, where each entry, which corresponds to a src-dst pair, has a
linked list packets.
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/send.c')
-rw-r--r-- | net/batman-adv/send.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index a67cffde37ae..263cfd1ccee7 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "vis.h" | 27 | #include "vis.h" |
28 | #include "gateway_common.h" | 28 | #include "gateway_common.h" |
29 | #include "originator.h" | 29 | #include "originator.h" |
30 | #include "network-coding.h" | ||
30 | 31 | ||
31 | #include <linux/if_ether.h> | 32 | #include <linux/if_ether.h> |
32 | 33 | ||
@@ -39,6 +40,7 @@ int batadv_send_skb_packet(struct sk_buff *skb, | |||
39 | struct batadv_hard_iface *hard_iface, | 40 | struct batadv_hard_iface *hard_iface, |
40 | const uint8_t *dst_addr) | 41 | const uint8_t *dst_addr) |
41 | { | 42 | { |
43 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | ||
42 | struct ethhdr *ethhdr; | 44 | struct ethhdr *ethhdr; |
43 | 45 | ||
44 | if (hard_iface->if_status != BATADV_IF_ACTIVE) | 46 | if (hard_iface->if_status != BATADV_IF_ACTIVE) |
@@ -70,6 +72,9 @@ int batadv_send_skb_packet(struct sk_buff *skb, | |||
70 | 72 | ||
71 | skb->dev = hard_iface->net_dev; | 73 | skb->dev = hard_iface->net_dev; |
72 | 74 | ||
75 | /* Save a clone of the skb to use when decoding coded packets */ | ||
76 | batadv_nc_skb_store_for_decoding(bat_priv, skb); | ||
77 | |||
73 | /* dev_queue_xmit() returns a negative result on error. However on | 78 | /* dev_queue_xmit() returns a negative result on error. However on |
74 | * congestion and traffic shaping, it drops and returns NET_XMIT_DROP | 79 | * congestion and traffic shaping, it drops and returns NET_XMIT_DROP |
75 | * (which is > 0). This will not be treated as an error. | 80 | * (which is > 0). This will not be treated as an error. |