networkd-netdev-tuntap.c revision 3be1d7e0c5bf60658d34eb6311d4e77c6803578c
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Susant Sahani <susant@redhat.com>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd-netdev-tuntap.h"
else
if (!netdev->packet_info)
if (netdev->multi_queue)
return 0;
}
_cleanup_close_ int fd;
const char *user;
const char *group;
int r = 0;
if (fd < 0) {
"Failed to open tun dev: %s",
strerror(-r));
return r;
}
if (r < 0) {
"TUNSETIFF failed on tun dev: %s",
strerror(-r));
return r;
}
if (r < 0) {
log_error("Cannot resolve user name %s: %s",
return 0;
}
if ( r < 0) {
"TUNSETOWNER failed on tun dev: %s",
strerror(-r));
}
}
if(netdev->group_name) {
if (r < 0) {
log_error("Cannot resolve group name %s: %s",
return 0;
}
if( r < 0) {
"TUNSETGROUP failed on tun dev: %s",
strerror(-r));
return r;
}
}
if (r < 0) {
"TUNSETPERSIST failed on tun dev: %s",
strerror(-r));
return r;
}
return r;
}
int r;
case NETDEV_KIND_TUN:
case NETDEV_KIND_TAP:
break;
default:
return -ENOTSUP;
}
if(r < 0)
return r;
}
const NetDevVTable tun_vtable = {
};
const NetDevVTable tap_vtable = {
};