Commit 8698529d authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Marek Lindner

batman-adv: add_bcast_packet_to_list() takes the sending delay as parameter

In order to make possible to use the broadcast list for delayed sendings
the "delay" parameter is now provided instead of using 1 as hardcoded
value.
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent 5fbc1598
...@@ -1677,7 +1677,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -1677,7 +1677,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
spin_unlock_bh(&orig_node->bcast_seqno_lock); spin_unlock_bh(&orig_node->bcast_seqno_lock);
/* rebroadcast packet */ /* rebroadcast packet */
add_bcast_packet_to_list(bat_priv, skb); add_bcast_packet_to_list(bat_priv, skb, 1);
/* broadcast for me */ /* broadcast for me */
interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size); interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size);
......
...@@ -455,7 +455,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv, ...@@ -455,7 +455,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
* The skb is not consumed, so the caller should make sure that the * The skb is not consumed, so the caller should make sure that the
* skb is freed. */ * skb is freed. */
int add_bcast_packet_to_list(struct bat_priv *bat_priv, int add_bcast_packet_to_list(struct bat_priv *bat_priv,
const struct sk_buff *skb) const struct sk_buff *skb, unsigned long delay)
{ {
struct hard_iface *primary_if = NULL; struct hard_iface *primary_if = NULL;
struct forw_packet *forw_packet; struct forw_packet *forw_packet;
...@@ -492,7 +492,7 @@ int add_bcast_packet_to_list(struct bat_priv *bat_priv, ...@@ -492,7 +492,7 @@ int add_bcast_packet_to_list(struct bat_priv *bat_priv,
/* how often did we send the bcast packet ? */ /* how often did we send the bcast packet ? */
forw_packet->num_packets = 0; forw_packet->num_packets = 0;
_add_bcast_packet_to_list(bat_priv, forw_packet, 1); _add_bcast_packet_to_list(bat_priv, forw_packet, delay);
return NETDEV_TX_OK; return NETDEV_TX_OK;
packet_free: packet_free:
......
...@@ -31,7 +31,7 @@ void schedule_forward_packet(struct orig_node *orig_node, ...@@ -31,7 +31,7 @@ void schedule_forward_packet(struct orig_node *orig_node,
int directlink, int directlink,
struct hard_iface *if_outgoing); struct hard_iface *if_outgoing);
int add_bcast_packet_to_list(struct bat_priv *bat_priv, int add_bcast_packet_to_list(struct bat_priv *bat_priv,
const struct sk_buff *skb); const struct sk_buff *skb, unsigned long delay);
void send_outstanding_bat_packet(struct work_struct *work); void send_outstanding_bat_packet(struct work_struct *work);
void purge_outstanding_packets(struct bat_priv *bat_priv, void purge_outstanding_packets(struct bat_priv *bat_priv,
const struct hard_iface *hard_iface); const struct hard_iface *hard_iface);
......
...@@ -634,7 +634,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) ...@@ -634,7 +634,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
bcast_packet->seqno = bcast_packet->seqno =
htonl(atomic_inc_return(&bat_priv->bcast_seqno)); htonl(atomic_inc_return(&bat_priv->bcast_seqno));
add_bcast_packet_to_list(bat_priv, skb); add_bcast_packet_to_list(bat_priv, skb, 1);
/* a copy is stored in the bcast list, therefore removing /* a copy is stored in the bcast list, therefore removing
* the original skb. */ * the original skb. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment