File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 12
12
* GNU General Public License for more details.
13
13
*/
14
14
15
+ #include <linux/inet.h>
15
16
#include <linux/kthread.h>
16
17
#include <linux/list.h>
17
18
#include <linux/radix-tree.h>
18
19
#include <linux/module.h>
19
20
#include <linux/semaphore.h>
20
21
#include <linux/wait.h>
22
+ #include <net/sock.h>
23
+ #include <net/inet_common.h>
24
+ #include <net/inet_connection_sock.h>
25
+ #include <net/request_sock.h>
21
26
22
27
#include <xen/events.h>
23
28
#include <xen/grant_table.h>
@@ -52,6 +57,28 @@ struct pvcalls_fedata {
52
57
static int pvcalls_back_socket (struct xenbus_device * dev ,
53
58
struct xen_pvcalls_request * req )
54
59
{
60
+ struct pvcalls_fedata * fedata ;
61
+ int ret ;
62
+ struct xen_pvcalls_response * rsp ;
63
+
64
+ fedata = dev_get_drvdata (& dev -> dev );
65
+
66
+ if (req -> u .socket .domain != AF_INET ||
67
+ req -> u .socket .type != SOCK_STREAM ||
68
+ (req -> u .socket .protocol != IPPROTO_IP &&
69
+ req -> u .socket .protocol != AF_INET ))
70
+ ret = - EAFNOSUPPORT ;
71
+ else
72
+ ret = 0 ;
73
+
74
+ /* leave the actual socket allocation for later */
75
+
76
+ rsp = RING_GET_RESPONSE (& fedata -> ring , fedata -> ring .rsp_prod_pvt ++ );
77
+ rsp -> req_id = req -> req_id ;
78
+ rsp -> cmd = req -> cmd ;
79
+ rsp -> u .socket .id = req -> u .socket .id ;
80
+ rsp -> ret = ret ;
81
+
55
82
return 0 ;
56
83
}
57
84
You can’t perform that action at this time.
0 commit comments