- neigh_entry = (struct neigh_entry *)(ndp_packet + 1);
- spin_lock_bh(&batman_if->neigh_list_lock);
- hlist_for_each_entry(neigh_node, node, &batman_if->neigh_list, list) {
if (entries_len + sizeof(struct neigh_entry) >
skb_tailroom(skb))
break;
memcpy(neigh_entry->addr, neigh_node->addr, ETH_ALEN);
neigh_entry->rq = neigh_node->rq;
ndp_packet->num_neighbors++;
neigh_entry++;
entries_len += sizeof(struct neigh_entry);
- }
- spin_unlock_bh(&batman_if->neigh_list_lock);
- skb_put(skb, entries_len);
Hi Linus
It might be worth while putting in a rate limited warning message if there is not enough space to put all the neighbors into the ndp message. A lot depends on how big your ndp packet is. If you are sending a 64 byte packet, you only have space for 4 neighbors. When the 5th neighbor appears, you are going to see problems, OGM will work, but ndp won't etc. If you are sending MTU size packets, then it is less of a problem, you can have over 180 neighbors, which should not be a problem...
Andrew