Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220381
b: refs/heads/master
c: 24fb009
h: refs/heads/master
i:
  220379: 4be5a0b
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Oct 19, 2010
1 parent 926be4f commit f754370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c45603024c8dd5321f9504b351df3cb825e5951
refs/heads/master: 24fb009bae18f2ef712800ee9b2f52c177d9d3f9
9 changes: 7 additions & 2 deletions trunk/drivers/staging/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
struct hna_global_entry *hna_global_entry;
struct hashtable_t *swaphash;
unsigned long flags;
int required_bytes;

spin_lock_irqsave(&bat_priv->hna_lhash_lock, flags);
hna_local_entry =
Expand All @@ -74,8 +75,12 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
/* only announce as many hosts as possible in the batman-packet and
space in batman_packet->num_hna That also should give a limit to
MAC-flooding. */
if ((bat_priv->num_local_hna + 1 > (ETH_DATA_LEN - BAT_PACKET_LEN)
/ ETH_ALEN) ||
required_bytes = (bat_priv->num_local_hna + 1) * ETH_ALEN;
required_bytes += BAT_PACKET_LEN;

if ((required_bytes > ETH_DATA_LEN) ||
(atomic_read(&bat_priv->aggregation_enabled) &&
required_bytes > MAX_AGGREGATION_BYTES) ||
(bat_priv->num_local_hna + 1 > 255)) {
bat_dbg(DBG_ROUTES, bat_priv,
"Can't add new local hna entry (%pM): "
Expand Down

0 comments on commit f754370

Please sign in to comment.