On Wed, Jul 31, 2013 at 10:47:39PM +0200, Antonio Quartulli wrote:
/* check whether the packet is a duplicate */
- if (batadv_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno,
- if (batadv_test_bit(orig_node->bcast_bits,
orig_node->last_bcast_seqno,
Is this change really neccesary? Looks rather random to me. :)
ntohl(bcast_packet->seqno))) goto spin_unlock;
- seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno;
- seqno = orig_node->last_bcast_seqno;
- seq_diff = ntohl(bcast_packet->seqno) - seqno;
Same here ... you are not using the seqno variable below, are you?
/* check whether the packet is old and the host just restarted. */ if (batadv_window_protected(bat_priv, seq_diff, @@ -1125,7 +1128,8 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, /* mark broadcast in flood history, update window position * if required. */
- if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
- if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits,
seq_diff, 1))
... same here.
orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
spin_unlock_bh(&orig_node->bcast_seqno_lock); diff --git a/types.h b/types.h index 0088a53..0c0d999 100644 --- a/types.h +++ b/types.h @@ -133,14 +133,28 @@ struct batadv_orig_node_vlan { };
/**
- struct batadv_orig_bat_iv - B.A.T.M.A.N. IV private orig_node members
- @bcast_own: bitfield containing the number of our OGMs this orig_node
- rebroadcasted "back" to us (relative to last_real_seqno)
- @bcast_own_sum: counted result of bcast_own
- @ogm_cnt_lock: lock protecting bcast_own, bcast_own_sum,
- neigh_node->real_bits & neigh_node->real_packet_count
Hmm, neigh_node is not part of this structure, please change the reference (if it's actually still protecting things).