Skip to content

Commit 74a0bd7

Browse files
tgrafdavem330
authored andcommitted
ip6mr: Do not use RTA_PUT() macros
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 92a395e commit 74a0bd7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎net/ipv6/ip6mr.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,8 +2104,9 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
21042104
if (c->mf6c_parent >= MAXMIFS)
21052105
return -ENOENT;
21062106

2107-
if (MIF_EXISTS(mrt, c->mf6c_parent))
2108-
RTA_PUT(skb, RTA_IIF, 4, &mrt->vif6_table[c->mf6c_parent].dev->ifindex);
2107+
if (MIF_EXISTS(mrt, c->mf6c_parent) &&
2108+
nla_put_u32(skb, RTA_IIF, mrt->vif6_table[c->mf6c_parent].dev->ifindex) < 0)
2109+
return -EMSGSIZE;
21092110

21102111
mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0));
21112112

0 commit comments

Comments
 (0)