From a1f4cf5791e7914f3e42f5462669353104fef8a9 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 19 Feb 2024 17:51:49 +0800 Subject: net: mctp: tests: create test skbs with the correct net and device In our test skb creation functions, we're not setting up the net and device data. This doesn't matter at the moment, but we will want to add support for distinct net IDs in future. Set the ->net identifier on the test MCTP device, and ensure that test skbs are set up with the correct device-related data on creation. Create a helper for setting skb->dev and mctp_skb_cb->net. We have a few cases where we're calling __mctp_cb() to initialise the cb (which we need for the above) separately, so integrate this into the skb creation helpers. Signed-off-by: Jeremy Kerr Signed-off-by: Paolo Abeni --- net/mctp/test/utils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net/mctp/test/utils.c') diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c index e03ba66bbe18..565763eb0211 100644 --- a/net/mctp/test/utils.c +++ b/net/mctp/test/utils.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -54,6 +55,7 @@ struct mctp_test_dev *mctp_test_create_dev(void) rcu_read_lock(); dev->mdev = __mctp_dev_get(ndev); + dev->mdev->net = mctp_default_net(dev_net(ndev)); rcu_read_unlock(); return dev; -- cgit v1.2.3-70-g09d2