[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220321084704.36370-2-sunshouxin@chinatelecom.cn>
Date: Mon, 21 Mar 2022 04:47:01 -0400
From: Sun Shouxin <sunshouxin@...natelecom.cn>
To: j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
yoshfuji@...ux-ipv6.org, dsahern@...nel.org, oliver@...kum.org
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
huyd12@...natelecom.cn, sunshouxin@...natelecom.cn
Subject: [PATCH v5 1/4] net:ipv6:Add void *data to ndisc_send_na function
Adds void *data to ndisc_send_na stub function and
ndisc_send_na direct function. Update all places that
use both ndisc_send_na to pass NULL as the data parameter.
Signed-off-by: Sun Shouxin <sunshouxin@...natelecom.cn>
---
drivers/net/usb/cdc_mbim.c | 3 ++-
include/net/ipv6_stubs.h | 3 ++-
include/net/ndisc.h | 3 ++-
net/ipv6/addrconf.c | 2 +-
net/ipv6/ndisc.c | 9 +++++----
5 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
index c89639381eca..fa3869b214a9 100644
--- a/drivers/net/usb/cdc_mbim.c
+++ b/drivers/net/usb/cdc_mbim.c
@@ -347,7 +347,8 @@ static void do_neigh_solicit(struct usbnet *dev, u8 *buf, u16 tci)
is_router /* router */,
true /* solicited */,
false /* override */,
- true /* inc_opt */);
+ true /* inc_opt */,
+ NULL);
out:
dev_put(netdev);
}
diff --git a/include/net/ipv6_stubs.h b/include/net/ipv6_stubs.h
index 45e0339be6fa..2b64ea6590b6 100644
--- a/include/net/ipv6_stubs.h
+++ b/include/net/ipv6_stubs.h
@@ -56,7 +56,8 @@ struct ipv6_stub {
void (*udpv6_encap_enable)(void);
void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
const struct in6_addr *solicited_addr,
- bool router, bool solicited, bool override, bool inc_opt);
+ bool router, bool solicited, bool override,
+ bool inc_opt, void *data);
#if IS_ENABLED(CONFIG_XFRM)
void (*xfrm6_local_rxpmtu)(struct sk_buff *skb, u32 mtu);
int (*xfrm6_udp_encap_rcv)(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index da7eec8669ec..24cf6e92fecc 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -460,7 +460,8 @@ void ndisc_send_rs(struct net_device *dev,
const struct in6_addr *saddr, const struct in6_addr *daddr);
void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
const struct in6_addr *solicited_addr,
- bool router, bool solicited, bool override, bool inc_opt);
+ bool router, bool solicited, bool override, bool inc_opt,
+ void *data);
void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index b22504176588..bb1912eacd90 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4217,7 +4217,7 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id,
ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifp->addr,
/*router=*/ !!ifp->idev->cnf.forwarding,
/*solicited=*/ false, /*override=*/ true,
- /*inc_opt=*/ true);
+ /*inc_opt=*/ true, NULL);
}
if (send_rs) {
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index fcb288b0ae13..f7bd7082abb4 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -518,7 +518,8 @@ EXPORT_SYMBOL(ndisc_send_skb);
void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
const struct in6_addr *solicited_addr,
- bool router, bool solicited, bool override, bool inc_opt)
+ bool router, bool solicited, bool override, bool inc_opt,
+ void *data)
{
struct sk_buff *skb;
struct in6_addr tmpaddr;
@@ -591,7 +592,7 @@ static void ndisc_send_unsol_na(struct net_device *dev)
ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifa->addr,
/*router=*/ !!idev->cnf.forwarding,
/*solicited=*/ false, /*override=*/ true,
- /*inc_opt=*/ true);
+ /*inc_opt=*/ true, NULL);
}
read_unlock_bh(&idev->lock);
@@ -932,7 +933,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
if (dad) {
ndisc_send_na(dev, &in6addr_linklocal_allnodes, &msg->target,
- !!is_router, false, (ifp != NULL), true);
+ !!is_router, false, ifp, true, NULL);
goto out;
}
@@ -954,7 +955,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
NDISC_NEIGHBOUR_SOLICITATION, &ndopts);
if (neigh || !dev->header_ops) {
ndisc_send_na(dev, saddr, &msg->target, !!is_router,
- true, (ifp != NULL && inc), inc);
+ true, (ifp && inc), inc, NULL);
if (neigh)
neigh_release(neigh);
}
--
2.27.0
Powered by blists - more mailing lists