/* -*-c-*-
*
- * $Id: tun-unet.c,v 1.6 2004/04/08 01:36:17 mdw Exp $
+ * $Id$
*
* Tunnel interface based on Linux Usernet
*
n = read(fd, buf_i, sizeof(buf_i));
if (n < 0) {
- a_warn("tunnel read failed (%s): %s", tun_ifname(t), strerror(errno));
+ a_warn("TUN %s read-error -- %s", tun_ifname(t), strerror(errno));
return;
}
IF_TRACING(T_TUNNEL, {
int f;
if ((fd = open("/dev/unet", O_RDWR)) < 0) {
- a_warn("open `/dev/unet' failed: %s", strerror(errno));
+ a_warn("TUN - open-error /dev/unet -- %s", strerror(errno));
return (-1);
}
fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
if ((f = ioctl(fd, UNIOCGIFFLAGS)) < 0 ||
ioctl(fd, UNIOCSIFFLAGS, f | IFF_POINTOPOINT)) {
- a_warn("couldn't set point-to-point flag: %s", strerror(errno));
+ a_warn("TUN - unet config-error -- %s", strerror(errno));
close(fd);
return (-1);
}
static char b[UNET_NAMEMAX];
struct unet_info uni;
if (ioctl(t->f.fd, UNIOCGINFO, &uni)) {
- a_warn("ioctl(UNIOCGINFO) failed: %s", strerror(errno));
+ a_warn("TUN - unet getinfo-error -- %s", strerror(errno));
return ("<error>");
}
if (strlen(uni.uni_ifname) + 1 > sizeof(b)) {
- a_warn("interface name too long!");
+ a_warn("TUN - unet ifname-too-long");
return ("<error>");
}
strcpy(b, uni.uni_ifname);