summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-09-12 18:45:54 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-24 15:08:19 +0200
commit6982b488e03b8e29e186f0c54cf5f80438cceadd (patch)
treed3332206449e3abaa98dfe3686cf78165e9ef381
parent581de96fc30b7fe44070f17a8a73f3374d38d6ff (diff)
downloadsssd-6982b488e03b8e29e186f0c54cf5f80438cceadd.tar.gz
sssd-6982b488e03b8e29e186f0c54cf5f80438cceadd.tar.bz2
sssd-6982b488e03b8e29e186f0c54cf5f80438cceadd.zip
Convert IN_MULTICAST parameter to host order
https://fedorahosted.org/sssd/ticket/2087 IN_MULTICAST accepts address in the host order, but network order was supplied.
-rw-r--r--src/monitor/monitor_netlink.c2
-rw-r--r--src/providers/dp_dyndns.c2
-rw-r--r--src/providers/ldap/sdap_async_sudo_hostinfo.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c
index c0134237..6baf1365 100644
--- a/src/monitor/monitor_netlink.c
+++ b/src/monitor/monitor_netlink.c
@@ -610,7 +610,7 @@ static bool route_is_multicast(struct rtnl_route *route_obj)
return false;
}
- return IN_MULTICAST(addr4->s_addr);
+ return IN_MULTICAST(ntohl(addr4->s_addr));
} else if (nl_addr_get_family(nl) == AF_INET6) {
addr6 = nl_addr_get_binary_addr(nl);
if (!addr6) {
diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c
index 7a342d1e..cd114313 100644
--- a/src/providers/dp_dyndns.c
+++ b/src/providers/dp_dyndns.c
@@ -184,7 +184,7 @@ ok_for_dns(struct sockaddr *sa)
} else if (inet_netof(*addr) == IN_LOOPBACKNET) {
DEBUG(SSSDBG_FUNC_DATA, ("Loopback IPv4 address %s\n", straddr));
return false;
- } else if ((addr->s_addr & 0xffff0000) == 0xa9fe0000) {
+ } else if ((addr->s_addr & htonl(0xffff0000)) == htonl(0xa9fe0000)) {
/* 169.254.0.0/16 */
DEBUG(SSSDBG_FUNC_DATA, ("Link-local IPv4 address %s\n", straddr));
return false;
diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c
index 4e33babd..f0c72810 100644
--- a/src/providers/ldap/sdap_async_sudo_hostinfo.c
+++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c
@@ -239,7 +239,7 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx,
}
/* ignore multicast */
- if (IN_MULTICAST(ip4_addr->sin_addr.s_addr)) {
+ if (IN_MULTICAST(ntohl(ip4_addr->sin_addr.s_addr))) {
continue;
}