[Devel,RHEL7,COMMIT] connector: take VE from socket upon callback

Submitted by Konstantin Khorenko on Aug. 31, 2017, 2:40 p.m.

Details

Message ID 201708311440.v7VEei76016591@finist_ce7.work
State New
Series "proc connector: containerize on per-VE basis"
Headers show

Commit Message

Konstantin Khorenko Aug. 31, 2017, 2:40 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.35.5
------>
commit d7f362627da257bcb656a806fa0ece3743371fd4
Author: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Date:   Thu Aug 31 17:40:44 2017 +0300

    connector: take VE from socket upon callback
    
    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@virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 drivers/connector/connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;