summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-18 16:09:30 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-18 16:10:51 +0200
commit0dd25fb9f005d8ab7ac4bc10a609d00569f8c56a (patch)
tree2f253672d8a0a97c8c19ba1ce2cad26a5bef62a8 /src/libsystemd/sd-rtnl
parentf41925b4e442a34c93ad120ef1426c974a047ed1 (diff)
change type for address family to "int"
Let's settle on a single type for all address family values, even if UNIX is very inconsitent on the precise type otherwise. Given that socket() is the primary entrypoint for the sockets API, and that uses "int", and "int" is relatively simple and generic, we settle on "int" for this.
Diffstat (limited to 'src/libsystemd/sd-rtnl')
-rw-r--r--src/libsystemd/sd-rtnl/local-addresses.h4
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c8
-rw-r--r--src/libsystemd/sd-rtnl/test-rtnl.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/libsystemd/sd-rtnl/local-addresses.h b/src/libsystemd/sd-rtnl/local-addresses.h
index d3dff8b8b0..c6e3559bf1 100644
--- a/src/libsystemd/sd-rtnl/local-addresses.h
+++ b/src/libsystemd/sd-rtnl/local-addresses.h
@@ -29,8 +29,8 @@
#include "in-addr-util.h"
struct local_address {
- int ifindex;
- unsigned char family, scope;
+ int family, ifindex;
+ unsigned char scope;
union in_addr_union address;
};
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index c0a38e148b..7f2e398b74 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -133,7 +133,7 @@ int sd_rtnl_message_route_set_scope(sd_rtnl_message *m, unsigned char scope) {
}
int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret,
- uint16_t nlmsg_type, unsigned char rtm_family) {
+ uint16_t nlmsg_type, int rtm_family) {
struct rtmsg *rtm;
int r;
@@ -275,7 +275,7 @@ int sd_rtnl_message_addr_set_scope(sd_rtnl_message *m, unsigned char scope) {
return 0;
}
-int sd_rtnl_message_addr_get_family(sd_rtnl_message *m, unsigned char *family) {
+int sd_rtnl_message_addr_get_family(sd_rtnl_message *m, int *family) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@@ -352,7 +352,7 @@ int sd_rtnl_message_addr_get_ifindex(sd_rtnl_message *m, int *ifindex) {
int sd_rtnl_message_new_addr(sd_rtnl *rtnl, sd_rtnl_message **ret,
uint16_t nlmsg_type, int index,
- unsigned char family) {
+ int family) {
struct ifaddrmsg *ifa;
int r;
@@ -383,7 +383,7 @@ int sd_rtnl_message_new_addr(sd_rtnl *rtnl, sd_rtnl_message **ret,
}
int sd_rtnl_message_new_addr_update(sd_rtnl *rtnl, sd_rtnl_message **ret,
- int index, unsigned char family) {
+ int index, int family) {
int r;
r = sd_rtnl_message_new_addr(rtnl, ret, RTM_NEWADDR, index, family);
diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c
index cd81acae77..082c9e4a01 100644
--- a/src/libsystemd/sd-rtnl/test-rtnl.c
+++ b/src/libsystemd/sd-rtnl/test-rtnl.c
@@ -334,8 +334,8 @@ static void test_get_addresses(sd_rtnl *rtnl) {
for (m = reply; m; m = sd_rtnl_message_next(m)) {
uint16_t type;
- unsigned char family, scope, flags;
- int ifindex;
+ unsigned char scope, flags;
+ int family, ifindex;
assert_se(sd_rtnl_message_get_type(m, &type) >= 0);
assert_se(type == RTM_NEWADDR);