[B.A.T.M.A.N.] NDP patches v4

Linus Lüssing
2010-12-31T15:46:15Z

Hi everyone,

thanks for all the feedback and reviewing again. The following updated patches
address Marek's comments and suggestions:
* Introducing a commit for renaming only
* batman_packet_ogm -> ogm_packet, batman_packet_ndp -> ndp_packet
* BAT_UNICAST followed by BAT_UNICAST_FRAG
* structs introduced in the patches where they're used, not earlier
(ndp_packet, neigh_entry)
* moved own_ndp_send_time to ndp.c
* checkpatch cleaning
* avoid losing ndp-interval setting on interface down/up
* fixed a potential memory leak in error cases
* skb_copy instead of skb_clone
* rebased to trunk
* removal of unnecessary include
* hlist instead of doubly linked list
* added a break in one list traversal
* secure neigh_list with rcu-locking + ref-counting
* rename rq_real_bits to ndp_rq_window
* use msecs_to_jiffies instead of manual HZ multiplication
* fix get_batman_if_by_netdev usage / refcounting
* adding licenses

Furthermore I've changed the following:
* use dev_kfree_skb instead of kfree_skb in case of successful
ndp packet reception and processing (so no simple NET_RX_DROP return value)
* adding include guards for ndp.h
* use "= seqno - 1" in ndp_create_neighbor(), otherwise ndp_update_neighbor_lq()
does not update tq/rq/last_valid on first ndp packet

Would be great if someone could check the usage of rcu-locking + refcounting.
I was also a little confused because in "Documentation/RCU/listRCU.txt" list_del_rcu()
and list_add_rcu() are not protected with a spinlock for the list here,
but in the batman-adv code we are usually having those extra locks. Do I have
to leave those spinlocks or can I remove them for adding/deleting entries in the
neigh_list?

Cheers, Linus