Cleanup GCC4 warnings about signedness.
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 6ec2509..f7e8905 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -32,7 +32,7 @@
int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions, int protocol)
{
- int addr_len;
+ socklen_t addr_len;
int sndbuf = 32768;
int rcvbuf = 32768;
diff --git a/lib/ll_addr.c b/lib/ll_addr.c
index ea3d660..581487d 100644
--- a/lib/ll_addr.c
+++ b/lib/ll_addr.c
@@ -53,7 +53,8 @@
return buf;
}
-int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
+/*NB: lladdr is char * (rather than u8 *) because sa_data is char * (1003.1g) */
+int ll_addr_a2n(char *lladdr, int len, char *arg)
{
if (strchr(arg, '.')) {
inet_prefix pfx;
diff --git a/lib/utils.c b/lib/utils.c
index 5954502..7d336eb 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -240,7 +240,7 @@
dst->bitlen = 32;
}
if (slash) {
- if (get_integer(&plen, slash+1, 0) || plen > dst->bitlen) {
+ if (get_unsigned(&plen, slash+1, 0) || plen > dst->bitlen) {
err = -1;
goto done;
}
@@ -504,9 +504,9 @@
}
-__u8* hexstring_n2a(const __u8 *str, int len, __u8 *buf, int blen)
+char *hexstring_n2a(const __u8 *str, int len, char *buf, int blen)
{
- __u8 *ptr = buf;
+ char *ptr = buf;
int i;
for (i=0; i<len; i++) {
@@ -523,7 +523,7 @@
return buf;
}
-__u8* hexstring_a2n(const __u8 *str, __u8 *buf, int blen)
+__u8* hexstring_a2n(const char *str, __u8 *buf, int blen)
{
int cnt = 0;