Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdf71426 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller
Browse files

net: fix indirect calls helpers for ptype list hooks.



As Eric noted, the current wrapper for ptype func hook inside
__netif_receive_skb_list_ptype() has no chance of avoiding the indirect
call: we enter such code path only for protocols other than ipv4 and
ipv6.

Instead we can wrap the list_func invocation.

v1 -> v2:
 - use the correct fix tag

Fixes: f5737cba ("net: use indirect calls helpers for ptype hook")
Suggested-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Acked-by: default avatarEdward Cree <ecree@solarflare.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ceae266b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5025,12 +5025,12 @@ static inline void __netif_receive_skb_list_ptype(struct list_head *head,
	if (list_empty(head))
		return;
	if (pt_prev->list_func != NULL)
		pt_prev->list_func(head, pt_prev, orig_dev);
		INDIRECT_CALL_INET(pt_prev->list_func, ipv6_list_rcv,
				   ip_list_rcv, head, pt_prev, orig_dev);
	else
		list_for_each_entry_safe(skb, next, head, list) {
			skb_list_del_init(skb);
			INDIRECT_CALL_INET(pt_prev->func, ipv6_rcv, ip_rcv, skb,
					   skb->dev, pt_prev, orig_dev);
			pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
		}
}