diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-02-18 14:47:12 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-02-18 14:47:12 +0100 |
commit | 5d194a8dabbd5ca8e48db5c330ff4c69e579da83 (patch) | |
tree | 5fd6517b27193c6519be7e846495b1b26f2fe1af | |
parent | 2eedbf21ac62b5e15f5ba896b1e8b7125c8052de (diff) |
socket: Use inet_pton instead of inet_addr
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -66,8 +66,8 @@ int socket_open_v4(uint16_t port) /* join the multicast group */ memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr.s_addr = inet_addr(LLMNR_IPV4_MCAST_ADDR); mreq.imr_interface.s_addr = INADDR_ANY; + inet_pton(AF_INET, LLMNR_IPV4_MCAST_ADDR, &mreq.imr_multiaddr); if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { log_err("Failed to join multicast group: %s\n", strerror(errno)); |