Download | Plain Text | No Line Numbers


  1. --- tcpserver.c.orig 2006-09-12 18:58:29.000000000 +0200
  2. +++ tcpserver.c 2006-09-12 19:01:47.000000000 +0200
  3. @@ -88,7 +88,7 @@
  4.  
  5. typedef struct
  6. {
  7. - char ip[4];
  8. + char ip[16];
  9. pid_t pid;
  10. } baby;
  11.  
  12. @@ -248,8 +248,13 @@
  13. long c1=0, cc=0;
  14. for (u=0; u < limit; u++)
  15. if (child[u].pid != 0) {
  16. - if (byte_equal(child[u].ip, 3, remoteip)) cc++;
  17. - if (byte_equal(child[u].ip, 4, remoteip)) c1++;
  18. + if (fakev4) {
  19. + if (byte_equal(child[u].ip, 15, remoteip)) cc++;
  20. + }
  21. + else {
  22. + if (byte_equal(child[u].ip, 12, remoteip)) cc++;
  23. + }
  24. + if (byte_equal(child[u].ip, 16, remoteip)) c1++;
  25. }
  26. if (maxconnc != -1 && (cc >= maxconnc)) flagdeny = 4;
  27. if (maxconnip != -1 && (c1 >= maxconnip)) flagdeny = 3;
  28. @@ -609,7 +614,7 @@
  29. default:
  30. for (u=0; u < limit; u++)
  31. if (child[u].pid == 0) {
  32. - byte_copy(child[u].ip,4,remoteip);
  33. + byte_copy(child[u].ip,16,remoteip);
  34. child[u].pid = pid;
  35. break;
  36. }
  37.