Commit 13a43d94 authored by David S. Miller's avatar David S. Miller

neigh: Convert over to dst_neigh_lookup_skb().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9d75166
...@@ -1201,10 +1201,23 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, ...@@ -1201,10 +1201,23 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
write_unlock_bh(&neigh->lock); write_unlock_bh(&neigh->lock);
rcu_read_lock(); rcu_read_lock();
/* On shaper/eql skb->dst->neighbour != neigh :( */
if (dst && (n2 = dst_get_neighbour_noref(dst)) != NULL) /* Why not just use 'neigh' as-is? The problem is that
* things such as shaper, eql, and sch_teql can end up
* using alternative, different, neigh objects to output
* the packet in the output path. So what we need to do
* here is re-lookup the top-level neigh in the path so
* we can reinject the packet there.
*/
n2 = NULL;
if (dst) {
n2 = dst_neigh_lookup_skb(dst, skb);
if (n2)
n1 = n2; n1 = n2;
}
n1->output(n1, skb); n1->output(n1, skb);
if (n2)
neigh_release(n2);
rcu_read_unlock(); rcu_read_unlock();
write_lock_bh(&neigh->lock); write_lock_bh(&neigh->lock);
......
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