Skip to content

Commit 21f839b

Browse files
SynchronicITfabiobaltieri
authored andcommitted
tests: net: mdns: updated interface to match unicast MDNS function
To add the functionality conform rfc6762 chapter 6.7 the interface for setup_dst_addr(...) has changed. This patch fixes the interface mismatch Signed-off-by: Vincent van der Locht <[email protected]>
1 parent a26a222 commit 21f839b

File tree

1 file changed

+4
-3
lines changed
  • tests/net/lib/dns_sd/src

1 file changed

+4
-3
lines changed

tests/net/lib/dns_sd/src/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extern int add_srv_record(const struct dns_sd_rec *inst, uint32_t ttl,
5353
extern size_t service_proto_size(const struct dns_sd_rec *ref);
5454
extern bool rec_is_valid(const struct dns_sd_rec *ref);
5555
extern int setup_dst_addr(int sock, sa_family_t family,
56+
struct sockaddr *src, socklen_t src_len,
5657
struct sockaddr *dst, socklen_t *dst_len);
5758

5859

@@ -685,7 +686,7 @@ ZTEST(dns_sd, test_setup_dst_addr)
685686
v4 = zsock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
686687
zassert_true(v4 >= 0, "Create IPv4 UDP context failed (%d)", -errno);
687688

688-
zassert_equal(0, setup_dst_addr(v4, AF_INET, &dst, &dst_len), "");
689+
zassert_equal(0, setup_dst_addr(v4, AF_INET, NULL, 0, &dst, &dst_len), "");
689690

690691
optlen = sizeof(int);
691692
(void)zsock_getsockopt(v4, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, &optlen);
@@ -708,7 +709,7 @@ ZTEST(dns_sd, test_setup_dst_addr)
708709
v6 = zsock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
709710
zassert_true(v6 >= 0, "Create IPv6 UDP context failed (%d)", -errno);
710711

711-
zassert_equal(0, setup_dst_addr(v6, AF_INET6, &dst, &dst_len), "");
712+
zassert_equal(0, setup_dst_addr(v6, AF_INET6, NULL, 0, &dst, &dst_len), "");
712713

713714
optlen = sizeof(int);
714715
(void)zsock_getsockopt(v6, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, &optlen);
@@ -729,7 +730,7 @@ ZTEST(dns_sd, test_setup_dst_addr)
729730
zassert_true(xx >= 0, "Create IPV4 udp socket failed");
730731

731732
zassert_equal(-EPFNOSUPPORT,
732-
setup_dst_addr(xx, AF_PACKET, &dst, &dst_len), "");
733+
setup_dst_addr(xx, AF_PACKET, NULL, 0, &dst, &dst_len), "");
733734
}
734735

735736
/** test for @ref dns_sd_is_service_type_enumeration */

0 commit comments

Comments
 (0)