use IN6_IS_ADDR_MULTICAST to check for multicast address

This commit is contained in:
Ralf Jung 2016-06-24 08:46:42 +02:00
parent 87f81d15f2
commit 11be23d2e2
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ static void serve(int sock) {
break; break;
} }
// Now "cmsg != NULL" tests whether we found the destination address at all. // Now "cmsg != NULL" tests whether we found the destination address at all.
const bool is_multicast = (cmsg != NULL) && destaddr.s6_addr[0] == 0xFF; const bool is_multicast = (cmsg != NULL) && IN6_IS_ADDR_MULTICAST(&destaddr);
const char *str = json_object_to_json_string_ext(result, JSON_C_TO_STRING_PLAIN); const char *str = json_object_to_json_string_ext(result, JSON_C_TO_STRING_PLAIN);