]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ipmr: Add route table ID to netlink cache reports
authorPaul Davey <paul.davey@alliedtelesis.co.nz>
Mon, 7 Sep 2020 22:04:06 +0000 (10:04 +1200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2020 19:25:51 +0000 (12:25 -0700)
Insert the multicast route table ID as a Netlink attribute to Netlink
cache report notifications.

When multiple route tables are in use it is necessary to have a way to
determine which route table a given cache report belongs to when
receiving the cache report.

Signed-off-by: Paul Davey <paul.davey@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/mroute.h
net/ipv4/ipmr.c

index 11c8c1fc1124d87b8c0a5d73edf77743710480ec..918f1ef32ffe05f3617ea14ffb273502c42e938a 100644 (file)
@@ -169,6 +169,7 @@ enum {
        IPMRA_CREPORT_SRC_ADDR,
        IPMRA_CREPORT_DST_ADDR,
        IPMRA_CREPORT_PKT,
+       IPMRA_CREPORT_TABLE,
        __IPMRA_CREPORT_MAX
 };
 #define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
index 876fd6ff1ff93c7629878f8931e66bd2e6a932d0..19b2f586319b24a77957556efa4274f30818ce40 100644 (file)
@@ -2396,6 +2396,7 @@ static size_t igmpmsg_netlink_msgsize(size_t payloadlen)
                + nla_total_size(4)     /* IPMRA_CREPORT_VIF_ID */
                + nla_total_size(4)     /* IPMRA_CREPORT_SRC_ADDR */
                + nla_total_size(4)     /* IPMRA_CREPORT_DST_ADDR */
+               + nla_total_size(4)     /* IPMRA_CREPORT_TABLE */
                                        /* IPMRA_CREPORT_PKT */
                + nla_total_size(payloadlen)
                ;
@@ -2431,7 +2432,8 @@ static void igmpmsg_netlink_event(struct mr_table *mrt, struct sk_buff *pkt)
            nla_put_in_addr(skb, IPMRA_CREPORT_SRC_ADDR,
                            msg->im_src.s_addr) ||
            nla_put_in_addr(skb, IPMRA_CREPORT_DST_ADDR,
-                           msg->im_dst.s_addr))
+                           msg->im_dst.s_addr) ||
+           nla_put_u32(skb, IPMRA_CREPORT_TABLE, mrt->id))
                goto nla_put_failure;
 
        nla = nla_reserve(skb, IPMRA_CREPORT_PKT, payloadlen);