Thread (5 messages) 5 messages, 4 authors, 7d ago

Re: [PATCH net v5 1/1] ipmr: only copy pktinfo to cache reports

flat view

From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-10-18 12:57:00

On Sat, Oct 17, 2026 at 01:05:49PM +0200, Eric Dumazet wrote:
One remaining issue: for the synthetic skbs built by ipmr_get_route(),
pkt->cb holds NETLINK_CB, not IPCB. ipv4_pktinfo_prepare() still reads
it as IPCB: the iif comes from creds.pid, and IPCB(pkt)->flags
(l3mdev bit) from netlink_skb_parms. Whatever ends up in the
IP_PKTINFO cmsg for these reports is meaningless.

These skbs are already identified by ip_hdr(skb)->version == 0, as
done in ipmr_cache_resolve() and ipmr_destroy_unres(), and they only
reach this point through the IGMPMSG_NOCACHE path.

Could you skip pktinfo preparation for them in v6, and leave the
report control block zeroed? Something like:

memset(skb->cb, 0, sizeof(skb->cb));

/* Route queries from ipmr_get_route() carry NETLINK_CB, not IPCB. */
if (ip_hdr(pkt)->version) {
        memcpy(pkt_cb, pkt->cb, sizeof(pkt_cb));
        ipv4_pktinfo_prepare(mroute_sk, pkt, false);
        *PKTINFO_SKB_CB(skb) = *PKTINFO_SKB_CB(pkt);
        memcpy(pkt->cb, pkt_cb, sizeof(pkt_cb));
}
Fine by me
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help