mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:17:34 +00:00
LookupServer: Use designated initializers for sockaddr_in
At least macOS has a non-standard sin_len field at the front of the struct that Linux and Serenity do not. On BSDs, the sin_len field must be initialized to the size of the structure. Co-Authored-By: Timon Kruiper <timonkruiper@gmail.com>
This commit is contained in:
parent
136b779a64
commit
579eb7cf41
1 changed files with 7 additions and 4 deletions
|
@ -36,12 +36,15 @@ private:
|
||||||
Name m_hostname;
|
Name m_hostname;
|
||||||
|
|
||||||
static constexpr sockaddr_in mdns_addr {
|
static constexpr sockaddr_in mdns_addr {
|
||||||
AF_INET,
|
#ifdef AK_OS_BSD_GENERIC
|
||||||
|
.sin_len = sizeof(struct sockaddr_in),
|
||||||
|
#endif
|
||||||
|
.sin_family = AF_INET,
|
||||||
// htons(5353)
|
// htons(5353)
|
||||||
0xe914,
|
.sin_port = 0xe914,
|
||||||
// 224.0.0.251
|
// 224.0.0.251
|
||||||
{ 0xfb0000e0 },
|
.sin_addr = { 0xfb0000e0 },
|
||||||
{ 0 }
|
.sin_zero = { 0 }
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue