mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
Added support for implicit binds
This commit is contained in:
parent
54958fd0cb
commit
192365e8e8
@ -562,6 +562,7 @@ int WSAAPI sendto(SOCKET fd, const char *buf, int len, int flags, const struct s
|
||||
unsigned char z6[] = {0,0,0,0,0,0};
|
||||
int sval, psize;
|
||||
struct sockaddr_in saddr;
|
||||
struct sockaddr_ipx baddr;
|
||||
ipx_packet *packet;
|
||||
ipx_nic *nic;
|
||||
|
||||
@ -577,8 +578,15 @@ int WSAAPI sendto(SOCKET fd, const char *buf, int len, int flags, const struct s
|
||||
}
|
||||
|
||||
if(!(sockptr->flags & IPX_BOUND)) {
|
||||
debug("fd %d: NO IMPLICIT BIND! SHIT!");
|
||||
/* TODO: Implicit bind */
|
||||
baddr.sa_family = AF_IPX;
|
||||
memset(baddr.sa_netnum, 0, 4);
|
||||
memset(baddr.sa_nodenum, 0, 6);
|
||||
baddr.sa_socket = 0;
|
||||
|
||||
if(bind(fd, (struct sockaddr*)&baddr, sizeof(baddr)) == -1) {
|
||||
debug("Implicit bind on %d failed: %s", (int)fd, w32_error(WSAGetLastError()));
|
||||
RETURN(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if(len > MAX_PACKET_SIZE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user