summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-08-08 17:14:23 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-08-08 17:14:23 +0200
commit5cdfe9527fd6dacb2d6080b91be3d844f28b20fb (patch)
treeb24f1e8167fce220301c4e8afd7f7522b0107c79
parent74c8dc28231e004b898657622b3e7d3eafd4567c (diff)
dev: Make device_mtu() return size_t
We don't return negative values and the MTU is supposed to be the (maximum) length of a packet, thus make it of type size_t. Most of the users in the code store it in size_t already anyway. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--dev.c5
-rw-r--r--dev.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/dev.c b/dev.c
index 5bbac71..9c7af15 100644
--- a/dev.c
+++ b/dev.c
@@ -112,9 +112,10 @@ int device_address(const char *ifname, int af, struct sockaddr_storage *ss)
return ret;
}
-int device_mtu(const char *ifname)
+size_t device_mtu(const char *ifname)
{
- int ret, sock, mtu = 0;
+ size_t mtu = 0;
+ int ret, sock;
struct ifreq ifr;
sock = af_socket(AF_INET);
diff --git a/dev.h b/dev.h
index 7bd1fb3..4bfc3f0 100644
--- a/dev.h
+++ b/dev.h
@@ -4,7 +4,7 @@
#include <sys/socket.h>
#include "built_in.h"
-extern int device_mtu(const char *ifname);
+extern size_t device_mtu(const char *ifname);
extern int device_address(const char *ifname, int af, struct sockaddr_storage *ss);
extern int device_ifindex(const char *ifname);
extern int device_type(const char *ifname);