summaryrefslogtreecommitdiff
path: root/astraceroute.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-05-27 10:59:52 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-05-27 10:59:52 +0200
commit5160c9212e0e55e0dc518aadca0e6a370cf1420d (patch)
treeb5fb172ab10010321fb383b2aa3b8e0c058a0da7 /astraceroute.c
parent2e7e42af61fea74bfbb40abdc8318366638672fb (diff)
geoip: Pass struct sockaddr_in{,6} as pointer instead of by value
Change the interface to the geoip_* functions to take a pointer to a struct sockaddr_in{,6} instead of the struct itself. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'astraceroute.c')
-rw-r--r--astraceroute.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/astraceroute.c b/astraceroute.c
index e9d876d..2f3449e 100644
--- a/astraceroute.c
+++ b/astraceroute.c
@@ -469,9 +469,9 @@ static void handle_ipv4(uint8_t *packet, size_t len __maybe_unused,
getnameinfo((struct sockaddr *) &sd, sizeof(sd),
hbuff, sizeof(hbuff), NULL, 0, NI_NUMERICHOST);
- as = geoip4_as_name(sd);
- country = geoip4_country_name(sd);
- city = geoip4_city_name(sd);
+ as = geoip4_as_name(&sd);
+ country = geoip4_country_name(&sd);
+ city = geoip4_city_name(&sd);
if (dns_resolv) {
hent = gethostbyaddr(&sd.sin_addr, sizeof(sd.sin_addr), PF_INET);
@@ -490,7 +490,7 @@ static void handle_ipv4(uint8_t *packet, size_t len __maybe_unused,
printf(", %s", city);
}
if (latitude)
- printf(" (%f/%f)", geoip4_latitude(sd), geoip4_longitude(sd));
+ printf(" (%f/%f)", geoip4_latitude(&sd), geoip4_longitude(&sd));
}
static int check_ipv6(uint8_t *packet, size_t len, int ttl __maybe_unused,
@@ -536,9 +536,9 @@ static void handle_ipv6(uint8_t *packet, size_t len __maybe_unused,
getnameinfo((struct sockaddr *) &sd, sizeof(sd),
hbuff, sizeof(hbuff), NULL, 0, NI_NUMERICHOST);
- as = geoip6_as_name(sd);
- country = geoip6_country_name(sd);
- city = geoip6_city_name(sd);
+ as = geoip6_as_name(&sd);
+ country = geoip6_country_name(&sd);
+ city = geoip6_city_name(&sd);
if (dns_resolv) {
hent = gethostbyaddr(&sd.sin6_addr, sizeof(sd.sin6_addr), PF_INET6);
@@ -557,7 +557,7 @@ static void handle_ipv6(uint8_t *packet, size_t len __maybe_unused,
printf(", %s", city);
}
if (latitude)
- printf(" (%f/%f)", geoip6_latitude(sd), geoip6_longitude(sd));
+ printf(" (%f/%f)", geoip6_latitude(&sd), geoip6_longitude(&sd));
}
static void show_trace_info(struct ctx *ctx, const struct sockaddr_storage *ss,