Subject SHA-1 Author Date
Added support for FORCE_NET_V*_CONN_ERROR to return an error for connect syscall c221dc3ff63bcd28c2053694177a9a09ef9a6570 Catalin(ux) M. BOIE 2019-03-20 18:26:19
rpm changelog e7127f5191015b0b93c7108b6fa02fde7f0fe909 Catalin(ux) M. BOIE 2019-02-05 21:10:57
duilder update 71425ef75fbc076d6601ceadd52e81e678aabe57 Catalin(ux) M. BOIE 2019-02-05 21:09:29
Switch to v0.13 7a5ed99fa6629ff9dbe16f6b015712a78854b621 Catalin(ux) M. BOIE 2019-02-05 21:08:06
Lots of changes e11f13f4d11723f0c2c833ffbaca89e55d74e139 Catalin(ux) M. BOIE 2019-01-16 20:18:06
Restart accept interrupted by signal d84134f3193fd2d4c5298eaded8ffade5d74d220 Catalin(ux) M. BOIE 2014-11-11 06:57:12
Bump version to 0.12 ea1c70a262b706cd45f1eb98b6aa9805de300647 Catalin(ux) M. BOIE 2014-10-14 03:14:29
Added support to change poll timeout d0e5782e1fb0da5db1291b3c518486d3ac8dec97 Catalin(ux) M. BOIE 2014-10-14 03:13:58
Fixed strcmp on a NULL variable 59df6d596e3c842227f4f374b4b6635de3ce1c3e Catalin(ux) M. BOIE 2014-10-14 03:12:29
Added support for deny and fake for Kevin d9598fd2ca7886484b78512d71dbd29059720832 Catalin(ux) M. BOIE 2012-07-18 21:13:20
Commit d84134f3193fd2d4c5298eaded8ffade5d74d220 - Restart accept interrupted by signal
Author: Catalin(ux) M. BOIE
Author date (UTC): 2014-11-11 06:57
Committer: Catalin(ux) M. BOIE
Commit date (UTC): 2014-11-11 06:57
Tree: 65b1a978aad9cf646c4d8a386f37114463557ccf
Parents: ea1c70a262b706cd45f1eb98b6aa9805de300647
File Lines added Lines deleted
.gitignore 1 0
Makefile.in 2 1
TODO 3 2
configure 1 1
force_bind.c 10 3
test_poll.sh 5 4

File .gitignore changed (mode: 100644) (index 7e0257f..69a15ea)
... ... test_client6
10 10 *.out *.out
11 11 *.log *.log
12 12 force_bind_config.h force_bind_config.h
13 test_poll

File Makefile.in changed (mode: 100644) (index b881de1..dbec961)
... ... test_poll: test_poll.c
29 29 clean: clean:
30 30 @rm -f force_bind.so.* test_bind send_udp test_client test_client6 \ @rm -f force_bind.so.* test_bind send_udp test_client test_client6 \
31 31 *.a *.o *.so* $(PRJ)-*.rpm $(PRJ)-*-*-*.tgz $(PRJ)-*.tar.gz \ *.a *.o *.so* $(PRJ)-*.rpm $(PRJ)-*-*-*.tgz $(PRJ)-*.tar.gz \
32 *.strace *.log *.out
32 *.strace *.log *.out \
33 test_poll
33 34
34 35 install: all install: all
35 36 @mkdir -p $(I_USR_LIB) @mkdir -p $(I_USR_LIB)

File TODO changed (mode: 100644) (index ffddfcc..34189a5)
1 [ ] Clarify deny/fake for bind. It is only ipv4/ipv6?
1 2 [ ] Document force_poll_timeout [ ] Document force_poll_timeout
2 3 [ ] Split binding on connect from the one used for listen. [ ] Split binding on connect from the one used for listen.
3 4 [ ] If we have more bind calls, we have a problem. Probably we have to use a table like this: [ ] If we have more bind calls, we have a problem. Probably we have to use a table like this:
 
19 20 [ ] Dump statistics (bytes, syscalls etc.) in a file specified by a env var. [ ] Dump statistics (bytes, syscalls etc.) in a file specified by a env var.
20 21 [ ] Need to study how to set only the class for IPv6. Also check Linux kernel [ ] Need to study how to set only the class for IPv6. Also check Linux kernel
21 22 to see how prio is set for IPv6 class. to see how prio is set for IPv6 class.
22 [ ] Nice: Force a protocol on a connection! So, user tries TCP but get UDP!
23 [ ] Nice: Force a protocol on a connection! So, user tries TCP but gets UDP!
23 24 [ ] Controlling timeout (SO_RCVTIMEO, SO_SNDTIMEO) [ ] Controlling timeout (SO_RCVTIMEO, SO_SNDTIMEO)
24 25 [ ] Enforce connect timeout [ ] Enforce connect timeout
25 [ ] Change data on the fly...
26 [ ] Change data on the fly!!!
26 27 [ ] Allow saving stream data in a file. [ ] Allow saving stream data in a file.
27 28 [ ] sendmmsg/recvmmsg support [ ] sendmmsg/recvmmsg support
28 29 [ ] There are stupid applications (skype) that run poll with timeout 0! Fix it! [ ] There are stupid applications (skype) that run poll with timeout 0! Fix it!

File configure changed (mode: 100755) (index d33bb6c..92c4bc4)
1 1 #!/bin/bash #!/bin/bash
2 2
3 ./duilder
3 ./duilder "${@}"

File force_bind.c changed (mode: 100644) (index 6e89448..d0c3e3b)
... ... int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
1222 1222
1223 1223 xlog(2, "accept(sockfd=%d, ...)\n", sockfd); xlog(2, "accept(sockfd=%d, ...)\n", sockfd);
1224 1224
1225 new_sock = old_accept(sockfd, addr, addrlen);
1226 if (new_sock == -1)
1227 return -1;
1225 while (1) {
1226 new_sock = old_accept(sockfd, addr, addrlen);
1227 if (new_sock == -1) {
1228 if (errno == EINTR)
1229 continue;
1230 return -1;
1231 }
1232
1233 break;
1234 }
1228 1235
1229 1236 /* We must find out domain and type for accepting socket */ /* We must find out domain and type for accepting socket */
1230 1237 q = get(sockfd); q = get(sockfd);

File test_poll.sh copied from file test_fake.sh (similarity 50%) (mode: 100755) (index acf74df..c76f423)
4 4
5 5 ulimit -c2000000 ulimit -c2000000
6 6
7 export FORCE_BIND_ADDRESS_V4=fake
8 export FORCE_NET_LOG="test_fake.sh.log"
7 export FORCE_BIND_POLL_TIMEOUT=2000
9 8 export FORCE_NET_VERBOSE=1 export FORCE_NET_VERBOSE=1
9 export FORCE_NET_LOG="${0}.log"
10 10
11 11 export LD_PRELOAD="${LD_PRELOAD}:./force_bind.so" export LD_PRELOAD="${LD_PRELOAD}:./force_bind.so"
12 12
13 make test_bind
14 strace -f -s200 -o ${0}.strace ./test_bind 10000
13 make test_poll
14 #strace -f -s200 -o ${0}.strace ./test_poll
15 debug ./test_poll
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/force_bind

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/force_bind

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/force_bind

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master