Skip to content

Commit 060295c

Browse files
jukkarhenrikbrixandersen
authored andcommitted
net: dns: responders: Set the multicast TTL or hoplimit
We are creating a multicast address in mDNS or LLMNR responder so set the TTL or hoplimit using the multicast variant API. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent fc006d7 commit 060295c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/net/lib/dns/llmnr_responder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static int create_ipv4_answer(struct net_context *ctx,
339339
return -ENOMEM;
340340
}
341341

342-
net_context_set_ipv4_ttl(ctx, 255);
342+
net_context_set_ipv4_mcast_ttl(ctx, 255);
343343

344344
return 0;
345345
}
@@ -389,7 +389,7 @@ static int create_ipv6_answer(struct net_context *ctx,
389389
return -ENOMEM;
390390
}
391391

392-
net_context_set_ipv6_hop_limit(ctx, 255);
392+
net_context_set_ipv6_mcast_hop_limit(ctx, 255);
393393

394394
#endif /* CONFIG_NET_IPV6 */
395395
return 0;

subsys/net/lib/dns/mdns_responder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ int setup_dst_addr(struct net_context *ctx, sa_family_t family,
110110
if (IS_ENABLED(CONFIG_NET_IPV4) && family == AF_INET) {
111111
create_ipv4_addr(net_sin(dst));
112112
*dst_len = sizeof(struct sockaddr_in);
113-
net_context_set_ipv4_ttl(ctx, 255);
113+
net_context_set_ipv4_mcast_ttl(ctx, 255);
114114
} else if (IS_ENABLED(CONFIG_NET_IPV6) && family == AF_INET6) {
115115
create_ipv6_addr(net_sin6(dst));
116116
*dst_len = sizeof(struct sockaddr_in6);
117-
net_context_set_ipv6_hop_limit(ctx, 255);
117+
net_context_set_ipv6_mcast_hop_limit(ctx, 255);
118118
} else {
119119
return -EPFNOSUPPORT;
120120
}

0 commit comments

Comments
 (0)