Skip to content

Commit 2798a19

Browse files
BenWiederhakealimpfard
authored andcommitted
LibC+LookupServer: Use u32 for the endpoint magic
That's how LibIPC treats it, too.
1 parent 34a8ee6 commit 2798a19

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Userland/Libraries/LibC/netdb.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static in_addr_t* __gethostbyaddr_address_list_buffer[2];
3333
// a chicken-and-egg situation. Because of this, the LookupServer endpoint magic
3434
// is hardcoded here.
3535
// Keep the name synchronized with LookupServer/LookupServer.ipc.
36-
static constexpr i32 lookup_server_endpoint_magic = "LookupServer"sv.hash();
36+
static constexpr u32 lookup_server_endpoint_magic = "LookupServer"sv.hash();
3737

3838
// Get service entry buffers and file information for the getservent() family of functions.
3939
static FILE* services_file = nullptr;
@@ -115,7 +115,7 @@ hostent* gethostbyname(const char* name)
115115

116116
struct [[gnu::packed]] {
117117
u32 message_size;
118-
i32 endpoint_magic;
118+
u32 endpoint_magic;
119119
i32 message_id;
120120
i32 name_length;
121121
} request_header = {
@@ -139,7 +139,7 @@ hostent* gethostbyname(const char* name)
139139

140140
struct [[gnu::packed]] {
141141
u32 message_size;
142-
i32 endpoint_magic;
142+
u32 endpoint_magic;
143143
i32 message_id;
144144
i32 code;
145145
u64 addresses_count;
@@ -215,7 +215,7 @@ hostent* gethostbyaddr(const void* addr, socklen_t addr_size, int type)
215215

216216
struct [[gnu::packed]] {
217217
u32 message_size;
218-
i32 endpoint_magic;
218+
u32 endpoint_magic;
219219
i32 message_id;
220220
i32 address_length;
221221
} request_header = {
@@ -239,7 +239,7 @@ hostent* gethostbyaddr(const void* addr, socklen_t addr_size, int type)
239239

240240
struct [[gnu::packed]] {
241241
u32 message_size;
242-
i32 endpoint_magic;
242+
u32 endpoint_magic;
243243
i32 message_id;
244244
i32 code;
245245
i32 name_length;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Keep the name synchronized with LibC/netdb.cpp, constant 'lookup_server_endpoint_magic'.
22
endpoint LookupServer
33
{
4+
// Keep these definitions synchronized with gethostbyname and gethostbyaddr in netdb.cpp
45
lookup_name(String name) => (int code, Vector<String> addresses)
56
lookup_address(String address) => (int code, String name)
67
}

0 commit comments

Comments
 (0)