summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@hundeboll.net>2013-05-23 10:53:03 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-12 05:58:35 -0400
commitee75ed88879af88558818a5c6609d85f60ff0df4 (patch)
treeeb5edeaf224c481e962f8108bca429c6b1cc31d9 /net/batman-adv/soft-interface.c
parent610bfc6bc99bc83680d190ebc69359a05fc7f605 (diff)
batman-adv: Fragment and send skbs larger than mtu
Non-broadcast packets larger than MTU are fragmented and sent with an encapsulating header. Up to 16 fragments are supported, which are sent in reverse order on the wire to allow minimal memory copying when creating fragments. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r--net/batman-adv/soft-interface.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index dd189e6bf05a..18b1fd915d1f 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -442,6 +442,7 @@ static void batadv_softif_destroy_finish(struct work_struct *work)
442static int batadv_softif_init_late(struct net_device *dev) 442static int batadv_softif_init_late(struct net_device *dev)
443{ 443{
444 struct batadv_priv *bat_priv; 444 struct batadv_priv *bat_priv;
445 uint32_t random_seqno;
445 int ret; 446 int ret;
446 size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM; 447 size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM;
447 448
@@ -491,6 +492,10 @@ static int batadv_softif_init_late(struct net_device *dev)
491 bat_priv->tt.last_changeset = NULL; 492 bat_priv->tt.last_changeset = NULL;
492 bat_priv->tt.last_changeset_len = 0; 493 bat_priv->tt.last_changeset_len = 0;
493 494
495 /* randomize initial seqno to avoid collision */
496 get_random_bytes(&random_seqno, sizeof(random_seqno));
497 atomic_set(&bat_priv->frag_seqno, random_seqno);
498
494 bat_priv->primary_if = NULL; 499 bat_priv->primary_if = NULL;
495 bat_priv->num_ifaces = 0; 500 bat_priv->num_ifaces = 0;
496 501
@@ -758,6 +763,8 @@ static const struct {
758 { "mgmt_tx_bytes" }, 763 { "mgmt_tx_bytes" },
759 { "mgmt_rx" }, 764 { "mgmt_rx" },
760 { "mgmt_rx_bytes" }, 765 { "mgmt_rx_bytes" },
766 { "frag_tx" },
767 { "frag_tx_bytes" },
761 { "frag_rx" }, 768 { "frag_rx" },
762 { "frag_rx_bytes" }, 769 { "frag_rx_bytes" },
763 { "frag_fwd" }, 770 { "frag_fwd" },