[Devel] [PATCH v2 26/27] connector: take VE from socket upon callback

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Aug 17 17:01:13 MSK 2017


This is needed to attach listener to the right device. I.e. attach to the
right source of events (in terms of CT).

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 drivers/connector/connector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 771dadf..81854bf 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -130,7 +130,7 @@ EXPORT_SYMBOL_GPL(cn_netlink_send);
 static int cn_call_callback(struct sk_buff *skb)
 {
 	struct cn_callback_entry *i, *cbq = NULL;
-	struct cn_dev *dev = get_cdev(get_ve0());
+	struct cn_dev *dev = get_cdev(skb->sk->sk_net->owner_ve);
 	struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb));
 	struct netlink_skb_parms *nsp = &NETLINK_CB(skb);
 	int err = -ENODEV;



More information about the Devel mailing list