… | |
… | |
64 | fd = open (device, O_RDWR); |
64 | fd = open (device, O_RDWR); |
65 | |
65 | |
66 | if (fd < 0) |
66 | if (fd < 0) |
67 | { |
67 | { |
68 | slog (L_ERR, _("could not open device %s: %s"), device, strerror (errno)); |
68 | slog (L_ERR, _("could not open device %s: %s"), device, strerror (errno)); |
69 | exit (1); |
69 | exit (EXIT_FAILURE); |
70 | } |
70 | } |
71 | |
71 | |
72 | memset (&ifr, 0, sizeof (ifr)); |
72 | memset (&ifr, 0, sizeof (ifr)); |
73 | #if TEST_ETHEREMU |
73 | #if TEST_ETHEREMU |
74 | ifr.ifr_flags = IFF_TUN | IFF_NO_PI; |
74 | ifr.ifr_flags = IFF_TUN | IFF_NO_PI; |
… | |
… | |
87 | ifrname [IFNAMSIZ] = 0; |
87 | ifrname [IFNAMSIZ] = 0; |
88 | } |
88 | } |
89 | else |
89 | else |
90 | { |
90 | { |
91 | slog (L_CRIT, _("unable to configure tun/tap interface: %s"), strerror (errno)); |
91 | slog (L_CRIT, _("unable to configure tun/tap interface: %s"), strerror (errno)); |
92 | exit (1); |
92 | exit (EXIT_FAILURE); |
93 | } |
93 | } |
94 | |
94 | |
95 | if (ioctl (fd, TUNSETPERSIST, conf.ifpersist ? 1 : 0)) |
95 | if (ioctl (fd, TUNSETPERSIST, conf.ifpersist ? 1 : 0)) |
96 | slog (L_WARN, _("cannot set persistency mode for device %s: %s"), ifrname, strerror (errno)); |
96 | slog (L_WARN, _("cannot set persistency mode for device %s: %s"), ifrname, strerror (errno)); |
97 | |
97 | |