aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 4c8928319e1d..91a324cc2298 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -22,6 +22,7 @@
22#include <linux/if_packet.h> 22#include <linux/if_packet.h>
23#include <linux/if_arp.h> 23#include <linux/if_arp.h>
24#include <linux/if_tun.h> 24#include <linux/if_tun.h>
25#include <linux/if_macvlan.h>
25 26
26#include <net/sock.h> 27#include <net/sock.h>
27 28
@@ -452,13 +453,16 @@ err:
452 return ERR_PTR(r); 453 return ERR_PTR(r);
453} 454}
454 455
455static struct socket *get_tun_socket(int fd) 456static struct socket *get_tap_socket(int fd)
456{ 457{
457 struct file *file = fget(fd); 458 struct file *file = fget(fd);
458 struct socket *sock; 459 struct socket *sock;
459 if (!file) 460 if (!file)
460 return ERR_PTR(-EBADF); 461 return ERR_PTR(-EBADF);
461 sock = tun_get_socket(file); 462 sock = tun_get_socket(file);
463 if (!IS_ERR(sock))
464 return sock;
465 sock = macvtap_get_socket(file);
462 if (IS_ERR(sock)) 466 if (IS_ERR(sock))
463 fput(file); 467 fput(file);
464 return sock; 468 return sock;
@@ -473,7 +477,7 @@ static struct socket *get_socket(int fd)
473 sock = get_raw_socket(fd); 477 sock = get_raw_socket(fd);
474 if (!IS_ERR(sock)) 478 if (!IS_ERR(sock))
475 return sock; 479 return sock;
476 sock = get_tun_socket(fd); 480 sock = get_tap_socket(fd);
477 if (!IS_ERR(sock)) 481 if (!IS_ERR(sock))
478 return sock; 482 return sock;
479 return ERR_PTR(-ENOTSOCK); 483 return ERR_PTR(-ENOTSOCK);