I am trying to edit openssh package & add custom code to create socket and send some message. in other part of openssh package i am able to do but not able to perform same task in openssh-7.8p1->kex.c->choose_kex & in packet.c where we return error from
Code :
{
int sock = 0;
sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock < 0) {
debug("%s: Unable to create socket: %s",__func__, strerror(errno));
return;
}
close(sock);
}
above code return error with log : too many open files (error code:24)
is it not possible to create socket while ssh handshake in progress?