mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
ipv6: add a deletion reason argument to rt6_fill_node()
Add the deletion reason to rt6_fill_node() so that it can report it to user space. All callers pass RT_DEL_REASON_UNSPEC for now. Signed-off-by: Yuyang Huang <sigefriedhyy@gmail.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260808005642.26901-5-sigefriedhyy@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
e8636445b7
commit
b021510235
|
|
@ -111,7 +111,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
|
|||
struct fib6_info *rt, struct dst_entry *dst,
|
||||
struct in6_addr *dest, struct in6_addr *src,
|
||||
int iif, int type, u32 portid, u32 seq,
|
||||
unsigned int flags);
|
||||
unsigned int flags, enum rt_del_reason del_reason);
|
||||
static struct rt6_info *rt6_find_cached_rt(const struct fib6_result *res,
|
||||
const struct in6_addr *daddr,
|
||||
const struct in6_addr *saddr);
|
||||
|
|
@ -4037,7 +4037,8 @@ static int __ip6_del_rt_siblings(struct fib6_info *rt, struct fib6_config *cfg)
|
|||
|
||||
if (rt6_fill_node(net, skb, rt, NULL,
|
||||
NULL, NULL, 0, RTM_DELROUTE,
|
||||
info->portid, seq, 0) < 0) {
|
||||
info->portid, seq, 0,
|
||||
RT_DEL_REASON_UNSPEC) < 0) {
|
||||
kfree_skb(skb);
|
||||
skb = NULL;
|
||||
} else
|
||||
|
|
@ -5786,7 +5787,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
|
|||
struct fib6_info *rt, struct dst_entry *dst,
|
||||
struct in6_addr *dest, struct in6_addr *src,
|
||||
int iif, int type, u32 portid, u32 seq,
|
||||
unsigned int flags)
|
||||
unsigned int flags, enum rt_del_reason del_reason)
|
||||
{
|
||||
struct rt6_info *rt6 = dst_rt6_info(dst);
|
||||
struct rt6key *rt6_dst, *rt6_src;
|
||||
|
|
@ -6066,7 +6067,8 @@ static int rt6_nh_dump_exceptions(struct fib6_nh *nh, void *arg)
|
|||
&rt6_ex->rt6i->dst, NULL, NULL, 0,
|
||||
RTM_NEWROUTE,
|
||||
NETLINK_CB(dump->cb->skb).portid,
|
||||
dump->cb->nlh->nlmsg_seq, w->flags);
|
||||
dump->cb->nlh->nlmsg_seq, w->flags,
|
||||
RT_DEL_REASON_UNSPEC);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
@ -6114,7 +6116,8 @@ int rt6_dump_route(struct fib6_info *rt, void *p_arg, unsigned int skip)
|
|||
if (rt6_fill_node(net, arg->skb, rt, NULL, NULL, NULL,
|
||||
0, RTM_NEWROUTE,
|
||||
NETLINK_CB(arg->cb->skb).portid,
|
||||
arg->cb->nlh->nlmsg_seq, flags)) {
|
||||
arg->cb->nlh->nlmsg_seq, flags,
|
||||
RT_DEL_REASON_UNSPEC)) {
|
||||
return 0;
|
||||
}
|
||||
count++;
|
||||
|
|
@ -6347,12 +6350,14 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
|
|||
err = rt6_fill_node(net, skb, from, NULL, NULL, NULL,
|
||||
iif, RTM_NEWROUTE,
|
||||
NETLINK_CB(in_skb).portid,
|
||||
nlh->nlmsg_seq, 0);
|
||||
nlh->nlmsg_seq, 0,
|
||||
RT_DEL_REASON_UNSPEC);
|
||||
else
|
||||
err = rt6_fill_node(net, skb, from, dst, &fl6.daddr,
|
||||
&fl6.saddr, iif, RTM_NEWROUTE,
|
||||
NETLINK_CB(in_skb).portid,
|
||||
nlh->nlmsg_seq, 0);
|
||||
nlh->nlmsg_seq, 0,
|
||||
RT_DEL_REASON_UNSPEC);
|
||||
} else {
|
||||
err = -ENETUNREACH;
|
||||
}
|
||||
|
|
@ -6388,7 +6393,8 @@ void inet6_rt_notify(int event, struct fib6_info *rt, struct nl_info *info,
|
|||
goto errout;
|
||||
|
||||
err = rt6_fill_node(net, skb, rt, NULL, NULL, NULL, 0,
|
||||
event, info->portid, seq, nlm_flags);
|
||||
event, info->portid, seq, nlm_flags,
|
||||
RT_DEL_REASON_UNSPEC);
|
||||
if (err < 0) {
|
||||
kfree_skb(skb);
|
||||
/* -EMSGSIZE implies needed space grew under us. */
|
||||
|
|
@ -6421,7 +6427,8 @@ void fib6_rt_update(struct net *net, struct fib6_info *rt,
|
|||
goto errout;
|
||||
|
||||
err = rt6_fill_node(net, skb, rt, NULL, NULL, NULL, 0,
|
||||
RTM_NEWROUTE, info->portid, seq, NLM_F_REPLACE);
|
||||
RTM_NEWROUTE, info->portid, seq, NLM_F_REPLACE,
|
||||
RT_DEL_REASON_UNSPEC);
|
||||
if (err < 0) {
|
||||
/* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
|
||||
WARN_ON(err == -EMSGSIZE);
|
||||
|
|
@ -6474,7 +6481,7 @@ void fib6_info_hw_flags_set(struct net *net, struct fib6_info *f6i,
|
|||
}
|
||||
|
||||
err = rt6_fill_node(net, skb, f6i, NULL, NULL, NULL, 0, RTM_NEWROUTE, 0,
|
||||
0, 0);
|
||||
0, 0, RT_DEL_REASON_UNSPEC);
|
||||
if (err < 0) {
|
||||
/* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
|
||||
WARN_ON(err == -EMSGSIZE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user