Skip to content

Commit

Permalink
ipc: ensure protocol compatibility in connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Sep 7, 2024
1 parent b09a353 commit 5ce5aa1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ipc/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ int connect(Thread *t, int sd, const struct sockaddr *addr, socklen_t len) {
SocketDescriptor *peer = getLocalSocket(addr, len);

if(!peer) return -EADDRNOTAVAIL;
if(self->address.sa_family != peer->address.sa_family) return -EAFNOSUPPORT;
if(!peer->listener || !peer->backlogMax || !peer->backlog) return -ECONNREFUSED;
if(peer->backlogCount >= peer->backlogMax) return -ETIMEDOUT;

Expand Down

0 comments on commit 5ce5aa1

Please sign in to comment.