1 diff --git a/sysdep.c b/sysdep.c
2 index be10656..1f44cbd 100644
5 @@ -139,7 +139,7 @@ int tun_open(char *dev, enum if_mode_enum mode)
6 logmsg(LOG_ERR, "Can't set PPA %d", ppa);
9 - if ((muxid = ioctl(ip_fd, I_PLINK, if_fd)) < 0) {
10 + if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) {
11 logmsg(LOG_ERR, "Can't link TUN device to IP");
14 @@ -152,7 +152,7 @@ int tun_open(char *dev, enum if_mode_enum mode)
15 ifr.ifr_ip_muxid = muxid;
17 if (ioctl(ip_fd, SIOCSIFMUXID, &ifr) < 0) {
18 - ioctl(ip_fd, I_PUNLINK, muxid);
19 + ioctl(ip_fd, I_UNLINK, muxid);
20 logmsg(LOG_ERR, "Can't set multiplexor id");
23 @@ -497,7 +497,7 @@ int tun_close(int fd, char *dev)
27 - if (ioctl(ip_fd, I_PUNLINK, muxid) < 0) {
28 + if (ioctl(ip_fd, I_UNLINK, muxid) < 0) {
29 logmsg(LOG_ERR, "Can't unlink interface");
32 diff --git a/sysdep.c b/sysdep.c
33 index 1f44cbd..493a73a 100644
36 @@ -110,37 +110,37 @@ int tun_open(char *dev, enum if_mode_enum mode)
39 if ((ip_fd = open("/dev/ip", O_RDWR, 0)) < 0) {
40 - logmsg(LOG_ERR, "Can't open /dev/ip");
41 + syslog(LOG_ERR, "Can't open /dev/ip");
45 if ((tun_fd = open(((mode == IF_MODE_TUN) ? "/dev/tun" : "/dev/tap"), O_RDWR, 0)) < 0) {
46 - logmsg(LOG_ERR, "Can't open /dev/tun");
47 + syslog(LOG_ERR, "Can't open /dev/tun");
51 /* Assign a new PPA and get its unit number. */
52 if ((ppa = ioctl(tun_fd, TUNNEWPPA, ppa)) < 0) {
53 - logmsg(LOG_ERR, "Can't assign new interface");
54 + syslog(LOG_ERR, "Can't assign new interface");
58 if ((if_fd = open(((mode == IF_MODE_TUN) ? "/dev/tun" : "/dev/tap"), O_RDWR, 0)) < 0) {
59 - logmsg(LOG_ERR, "Can't open /dev/tun (2)");
60 + syslog(LOG_ERR, "Can't open /dev/tun (2)");
63 if (ioctl(if_fd, I_PUSH, "ip") < 0) {
64 - logmsg(LOG_ERR, "Can't push IP module");
65 + syslog(LOG_ERR, "Can't push IP module");
69 /* Assign ppa according to the unit number returned by tun device */
70 if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0 && errno != EEXIST) {
71 - logmsg(LOG_ERR, "Can't set PPA %d", ppa);
72 + syslog(LOG_ERR, "Can't set PPA %d", ppa);
75 if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) {
76 - logmsg(LOG_ERR, "Can't link TUN device to IP");
77 + syslog(LOG_ERR, "Can't link TUN device to IP");
81 @@ -153,7 +153,7 @@ int tun_open(char *dev, enum if_mode_enum mode)
83 if (ioctl(ip_fd, SIOCSIFMUXID, &ifr) < 0) {
84 ioctl(ip_fd, I_UNLINK, muxid);
85 - logmsg(LOG_ERR, "Can't set multiplexor id");
86 + syslog(LOG_ERR, "Can't set multiplexor id");
90 @@ -493,12 +493,12 @@ int tun_close(int fd, char *dev)
91 memset(&ifr, 0, sizeof(ifr));
92 strcpy(ifr.ifr_name, dev);
93 if (ioctl(ip_fd, SIOCGIFFLAGS, &ifr) < 0) {
94 - logmsg(LOG_ERR, "Can't get iface flags");
95 + syslog(LOG_ERR, "Can't get iface flags");
99 if (ioctl(ip_fd, I_UNLINK, muxid) < 0) {
100 - logmsg(LOG_ERR, "Can't unlink interface");
101 + syslog(LOG_ERR, "Can't unlink interface");