net: mctp: tests: create test skbs with the correct net and device
authorJeremy Kerr <jk@codeconstruct.com.au>
Mon, 19 Feb 2024 09:51:49 +0000 (17:51 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 22 Feb 2024 12:32:55 +0000 (13:32 +0100)
commita1f4cf5791e7914f3e42f5462669353104fef8a9
tree9b56a3605b3d4ee9888589498b80b350a19b4d83
parentfc944ecc4f1a287882d90441360a0ba61d45fd8b
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 <jk@codeconstruct.com.au>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mctp/test/route-test.c
net/mctp/test/utils.c