Menu

#51 PPTP server does not work OK any more when IP pool is full and a new user is trying connect to the server.

none
closed
None
1
2015-03-19
2014-10-15
Gavin Wan
No

I am working for PPTP server on my prodcut (Gentoo Linux). But I found an issue when IP pool is full and a new user is trying connect to the server. It causes users cannot connect to the server for a long time even all clients are disconnected.

The easy way to reproduce the issue is setting 1 IP pool and 2 users. The clients use windows, Steps as following:

  1. User A established a connection to the server.

  2. User B is trying to connect the server.

Case A: User A disconnects from the server while User B client is waiting: The User B connectes the server succeeds.

Case B: User A disconnects from the server while User B client is counting from 60s to 0s for next trying: The User B connects failed. And then User A and User B cannot connect to the server any more.

The reason:

The server tries to response the User B connecting after User A disconnects. For Case B, the User B is disconnected, but the server does not know User B is disconnected. And the server still tries to launch pptpctrl.

In the "main" function in pptpctrl.c, it gets the error of calling "getpeername" function, but it does not return from "main" function. So it always call function "pptp_handle_ctrl_connection". The function pptp_handle_ctrl_connection does not return back right now even the User B connects soket is disconnected already.

I attached my changes of pptpctrl.c. I added return from main function if "getsockname", "getpeername", or "Set non-blocking" has errors. It works for me. You may plan to change function "pptp_handle_ctrl_connection"

Gavin

Discussion

  • James Cameron

    James Cameron - 2014-10-18
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     I am working for PPTP server on my prodcut (Gentoo Linux). But I found an issue when IP pool is full and a new user is trying connect to the server. It causes users cannot connect to the server for a long time even all clients are disconnected.
    
     The easy way to reproduce the issue is setting 1 IP pool and 2 users. The clients use windows, Steps as following:
    
    • status: open --> pending
     
  • James Cameron

    James Cameron - 2014-10-18

    You did not attach your changes to pptpctrl.c.

    However, I have reviewed the bail() and main() functions and see a problem; bail() does not call exit(), and so execution of pptpctrl continues when it should terminate.

    The call to exit() was removed by me on 2004-04-22 in commit 0770455, which was the merge of 1.2.0 with 1.1.3. ChangeLog doesn't explain why.

    So I think this was a mistake, and I've reinstated it:

    http://sourceforge.net/p/poptop/git/ci/b84360bb7d2d1c603a9e99f0640e962673c135e7/

    Please test with my patch and let me know how it goes. This is especially important, because you can reproduce the problem, and I cannot.

     
    • Gavin Wan

      Gavin Wan - 2015-03-18

      I tested your changes. It worked for me. Thanks.

       
  • James Cameron

    James Cameron - 2015-03-19
    • status: pending --> closed
     
  • James Cameron

    James Cameron - 2015-03-19

    Thanks!

     

Log in to post a comment.