Replace bogus #else with #endif.
Found by cppcheck, which complained about lenin not being initialized, but the real problem is that reading packets would fail when using code compiled with --tunemu on a normal tun device.
This commit is contained in:
parent
d7636352ce
commit
6a51d89cf7
1 changed files with 1 additions and 2 deletions
|
|
@ -199,9 +199,8 @@ bool read_packet(vpn_packet_t *packet) {
|
||||||
if(device_type == DEVICE_TYPE_TUNEMU)
|
if(device_type == DEVICE_TYPE_TUNEMU)
|
||||||
lenin = tunemu_read(device_fd, packet->data + 14, MTU - 14);
|
lenin = tunemu_read(device_fd, packet->data + 14, MTU - 14);
|
||||||
else
|
else
|
||||||
#else
|
|
||||||
lenin = read(device_fd, packet->data + 14, MTU - 14);
|
|
||||||
#endif
|
#endif
|
||||||
|
lenin = read(device_fd, packet->data + 14, MTU - 14);
|
||||||
|
|
||||||
if(lenin <= 0) {
|
if(lenin <= 0) {
|
||||||
logger(LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
logger(LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue