summaryrefslogtreecommitdiff
path: root/arch/um/drivers/vector_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/vector_user.c')
-rw-r--r--arch/um/drivers/vector_user.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c
index 4291f1a5d342..4d6a78e31089 100644
--- a/arch/um/drivers/vector_user.c
+++ b/arch/um/drivers/vector_user.c
@@ -41,7 +41,6 @@
#define TRANS_RAW "raw"
#define TRANS_RAW_LEN strlen(TRANS_RAW)
-#define QDISC_FAIL "user_init_raw: could not disable qdisc on interface"
#define VNET_HDR_FAIL "could not enable vnet headers on fd %d"
#define TUN_GET_F_FAIL "tapraw: TUNGETFEATURES failed: %s"
#define L2TPV3_BIND_FAIL "l2tpv3_open : could not bind socket err=%i"
@@ -212,8 +211,6 @@ static struct vector_fds *user_init_raw_fds(struct arglist *ifspec)
int err = -ENOMEM;
char *iface;
struct vector_fds *result = NULL;
- int optval = 1;
-
iface = uml_vector_fetch_arg(ifspec, TOKEN_IFNAME);
if (iface == NULL)
@@ -256,12 +253,6 @@ static struct vector_fds *user_init_raw_fds(struct arglist *ifspec)
goto cleanup;
}
- if (setsockopt(txfd,
- SOL_PACKET, PACKET_QDISC_BYPASS,
- &optval, sizeof(optval)) != 0) {
- printk(UM_KERN_INFO QDISC_FAIL);
- }
-
result = uml_kmalloc(sizeof(struct vector_fds), UM_GFP_KERNEL);
if (result != NULL) {
result->rx_fd = rxfd;
@@ -281,6 +272,19 @@ cleanup:
return NULL;
}
+
+bool uml_raw_enable_qdisc_bypass(int fd)
+{
+ int optval = 1;
+
+ if (setsockopt(fd,
+ SOL_PACKET, PACKET_QDISC_BYPASS,
+ &optval, sizeof(optval)) != 0) {
+ return false;
+ }
+ return true;
+}
+
bool uml_raw_enable_vnet_headers(int fd)
{
int optval = 1;