Skip to content

Commit 49eee52

Browse files
committed
initial bind support fix
1 parent e9e1b71 commit 49eee52

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/libproxybound.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ static void do_init(void) {
136136
SETUP_SYM(send);
137137
SETUP_SYM(sendto);
138138
SETUP_SYM(sendmsg);
139+
SETUP_SYM(bind);
139140

140141
init_l = 1;
141142
}
@@ -481,7 +482,21 @@ int connect(int sock, const struct sockaddr *addr, socklen_t len) {
481482
}
482483

483484
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
484-
PDEBUG("bind: got a bind request\n\n");
485+
PDEBUG("bind: got a bind request\n");
486+
PDEBUG("bind: got a bind request\n");
487+
PDEBUG("bind: got a bind request\n");
488+
PDEBUG("bind: got a bind request\n");
489+
PDEBUG("bind: got a bind request\n");
490+
PDEBUG("bind: got a bind request\n");
491+
PDEBUG("bind: got a bind request\n");
492+
PDEBUG("bind: got a bind request\n");
493+
494+
/* If the real bind doesn't exist, we're stuffed */
495+
if (true_bind == NULL) {
496+
PDEBUG("unresolved symbol: bind\n\n");
497+
return -1;
498+
}
499+
485500
return true_bind(sockfd, *addr, addrlen);
486501
}
487502

@@ -522,7 +537,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct
522537
p_addr_in = &((struct sockaddr_in *) connaddr)->sin_addr;
523538
inet_ntop(AF_INET, p_addr_in, ip, sizeof(ip));
524539

525-
PDEBUG("sendmsg: ip: %s\n\n",ip);
540+
PDEBUG("sendto: ip: %s\n\n",ip);
526541

527542
//Allow local
528543
if ((ip[0] == '1') && (ip[1] == '2') && (ip[2] == '7') && (ip[3] == '.'))

0 commit comments

Comments
 (0)