summaryrefslogtreecommitdiff
path: root/src/nss-resolve
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/nss-resolve
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/nss-resolve')
-rw-r--r--src/nss-resolve/nss-resolve.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c
index c67f59e179..c172022d76 100644
--- a/src/nss-resolve/nss-resolve.c
+++ b/src/nss-resolve/nss-resolve.c
@@ -43,20 +43,20 @@ NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
-static int count_addresses(sd_bus_message *m, unsigned af, const char **canonical) {
+static int count_addresses(sd_bus_message *m, int af, const char **canonical) {
int c = 0, r;
assert(m);
assert(canonical);
- r = sd_bus_message_enter_container(m, 'a', "(yayi)");
+ r = sd_bus_message_enter_container(m, 'a', "(iayi)");
if (r < 0)
return r;
- while ((r = sd_bus_message_enter_container(m, 'r', "yayi")) > 0) {
- unsigned char family;
+ while ((r = sd_bus_message_enter_container(m, 'r', "iayi")) > 0) {
+ int family;
- r = sd_bus_message_read(m, "y", &family);
+ r = sd_bus_message_read(m, "i", &family);
if (r < 0)
return r;
@@ -178,17 +178,16 @@ enum nss_status _nss_resolve_gethostbyname4_r(
/* Second, append addresses */
r_tuple_first = (struct gaih_addrtuple*) (buffer + idx);
- r = sd_bus_message_enter_container(reply, 'a', "(yayi)");
+ r = sd_bus_message_enter_container(reply, 'a', "(iayi)");
if (r < 0)
goto fail;
- while ((r = sd_bus_message_enter_container(reply, 'r', "yayi")) > 0) {
- unsigned char family;
+ while ((r = sd_bus_message_enter_container(reply, 'r', "iayi")) > 0) {
+ int family, ifindex;
const void *a;
- int ifindex;
size_t sz;
- r = sd_bus_message_read(reply, "y", &family);
+ r = sd_bus_message_read(reply, "i", &family);
if (r < 0)
goto fail;
@@ -356,17 +355,16 @@ enum nss_status _nss_resolve_gethostbyname3_r(
/* Third, append addresses */
r_addr = buffer + idx;
- r = sd_bus_message_enter_container(reply, 'a', "(yayi)");
+ r = sd_bus_message_enter_container(reply, 'a', "(iayi)");
if (r < 0)
goto fail;
- while ((r = sd_bus_message_enter_container(reply, 'r', "yayi")) > 0) {
- unsigned char family;
+ while ((r = sd_bus_message_enter_container(reply, 'r', "iayi")) > 0) {
+ int family, ifindex;
const void *a;
- int ifindex;
size_t sz;
- r = sd_bus_message_read(reply, "y", &family);
+ r = sd_bus_message_read(reply, "i", &family);
if (r < 0)
goto fail;
@@ -487,7 +485,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
if (r < 0)
goto fail;
- r = sd_bus_message_append(req, "y", af);
+ r = sd_bus_message_append(req, "i", af);
if (r < 0)
goto fail;