summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-10-16 23:36:41 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2020-10-16 23:36:41 +0200
commit4a65ada7ca45415dce30aa11afa8f550975a34ec (patch)
treefe582f91e653471dcecc7bd3be016f3975c02d44
parentfb967676d21ffeb79cf1c118119b883721589d0b (diff)
detect sendto error
-rw-r--r--gre.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gre.c b/gre.c
index 3a44d8c..40ea9f9 100644
--- a/gre.c
+++ b/gre.c
@@ -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)