diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-10-16 23:36:41 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-10-16 23:36:41 +0200 |
commit | 4a65ada7ca45415dce30aa11afa8f550975a34ec (patch) | |
tree | fe582f91e653471dcecc7bd3be016f3975c02d44 | |
parent | fb967676d21ffeb79cf1c118119b883721589d0b (diff) |
detect sendto error
-rw-r--r-- | gre.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -423,8 +423,12 @@ static int tun_cb(void) return -1; } - sendto(sock, frame, n, 0, (struct sockaddr *)&dest, remote_len); - return 0; + ssize_t res = sendto(sock, frame, n, 0, (struct sockaddr *)&dest, remote_len); + if (res < 0) + { + perror("sendto"); + } + return res; } static int tun_new(short type, const char *dev) |