Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Sep 25, 2023
1 parent 2981f48 commit 209e182
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions net/kernel_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ class ETKernelSocketStream : public KernelSocketStream, public NotifyContext {
if (fd >= 0) etpoller.register_notifier(fd, this);
}

ETKernelSocketStream() : KernelSocketStream(AF_INET, true) {
ETKernelSocketStream(int socket_family, bool nonblocking) :
KernelSocketStream(socket_family, nonblocking) {
if (fd >= 0) etpoller.register_notifier(fd, this);
}

Expand Down Expand Up @@ -955,7 +956,7 @@ class ETKernelSocketClient : public KernelSocketClient {

protected:
KernelSocketStream* create_stream() override {
return new ETKernelSocketStream();
return new ETKernelSocketStream(m_socket_family, m_nonblocking);
}
};

Expand Down Expand Up @@ -990,7 +991,7 @@ class ETKernelSocketServer : public KernelSocketServer, public NotifyContext {

LogBuffer& operator<<(LogBuffer& log, const IPAddr addr) {
if (addr.is_ipv4())
return log.printf(addr.u8_1, '.', addr.u8_2, '.', addr.u8_3, '.', addr.u8_4);
return log.printf(addr.a, '.', addr.b, '.', addr.c, '.', addr.d);
else {
return log.printf(addr.to_string());
}
Expand Down
3 changes: 1 addition & 2 deletions net/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ namespace net
public:
union {
in6_addr addr = {};
struct { uint16_t _1, _2, _3, _4, _5, _6; uint8_t u8_1, u8_2, u8_3, u8_4; };
struct { uint16_t u16_1, u16_2, u16_3, u16_4, u16_5, u16_6, u16_7, u16_8; };
struct { uint16_t _1, _2, _3, _4, _5, _6; uint8_t a, b, c, d; };
};

// For compatibility, the default constructor is still 0.0.0.0 (IPv4)
Expand Down

0 comments on commit 209e182

Please sign in to comment.