ipmr: support IP_PKTINFO on cache report IGMP msg
authorLeone Fernando <leone4fernando@gmail.com>
Wed, 13 Dec 2023 16:19:35 +0000 (17:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:26 +0000 (15:35 -0800)
commit7b32e63f881432bf30f282328b8e64c6aa494ba2
treedd7dafd300362c4ed5a82f74a25ec85f97dd9667
parentd01b4a9296ec6982210e5e485d94dc1c3096a82b
ipmr: support IP_PKTINFO on cache report IGMP msg

[ Upstream commit bb7403655b3c3eb245d0ee330047cd3e20b3c4af ]

In order to support IP_PKTINFO on those packets, we need to call
ipv4_pktinfo_prepare.

When sending mrouted/pimd daemons a cache report IGMP msg, it is
unnecessary to set dst on the newly created skb.
It used to be necessary on older versions until
commit d826eb14ecef ("ipv4: PKTINFO doesnt need dst reference") which
changed the way IP_PKTINFO struct is been retrieved.

Changes from v1:
1. Undo changes in ipv4_pktinfo_prepare function. use it directly
   and copy the control block.

Fixes: d826eb14ecef ("ipv4: PKTINFO doesnt need dst reference")
Signed-off-by: Leone Fernando <leone4fernando@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/ipmr.c