summaryrefslogtreecommitdiff
path: root/socket.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-02-18 14:47:12 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-02-18 14:47:12 +0100
commit5d194a8dabbd5ca8e48db5c330ff4c69e579da83 (patch)
tree5fd6517b27193c6519be7e846495b1b26f2fe1af /socket.c
parent2eedbf21ac62b5e15f5ba896b1e8b7125c8052de (diff)
socket: Use inet_pton instead of inet_addr
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 6ecc447..e501c3a 100644
--- a/socket.c
+++ b/socket.c
@@ -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));