bugFreeciv - Bugs: bug #22463, find_next_free_port() and server...

 
 
Show feedback again

bug #22463: find_next_free_port() and server port bind() do not match

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Tue 12 Aug 2014 11:11:25 PM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.4.4, 2.5.0-beta2, 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 20 Aug 2014 10:17:09 PM UTC, SVN revision 25969:

Made find_next_free_port() criteria for acceptable port to match what server considers
acceptable when it actually binds the port. This should greatly reduce the cases where
client launches server with a port it cannot use.

See bug #22463

(Browse SVN revision 25969)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 20 Aug 2014 10:17:03 PM UTC, SVN revision 25968:

Made find_next_free_port() criteria for acceptable port to match what server considers
acceptable when it actually binds the port. This should greatly reduce the cases where
client launches server with a port it cannot use.

See bug #22463

(Browse SVN revision 25968)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 20 Aug 2014 10:16:58 PM UTC, SVN revision 25967:

Made find_next_free_port() criteria for acceptable port to match what server considers
acceptable when it actually binds the port. This should greatly reduce the cases where
client launches server with a port it cannot use.

See bug #22463

(Browse SVN revision 25967)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 15 Aug 2014 10:35:47 PM UTC, comment #2:

- Made IPv6 enabled client to check all addresses (accept "any"), not just IPv4 ones
- Added parameter "not_avail_ok" for find_next_free_port() to allow check to let EADDRNOTAVAIL pass like server bind() does
- Added comments near server side bind() about the importance of keeping client side check in sync
- Check return value of socket() in find_next_free_port() and log error if it fails
- Pass correct family to socket() call; one for the address being tested, not the general limit find_next_free_port() received and used in construction of the list

(file #21743)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 12 Aug 2014 11:58:00 PM UTC, comment #1:

Fix.

(file #21700)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 12 Aug 2014 11:11:25 PM UTC, original submission:

Investigating https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757876 I noticed (likely cause to it) that
find_next_free_port() considers port which is free in any interface, but server actually wants to bind() to all interfaces.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21743:  BindAll-2.patch added by cazfi (5kB - text/x-diff)
file #21700:  BindAll.patch added by cazfi (2kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Aug 2014 10:17:19 PM UTCcazfiStatusReady For Test=>Fixed
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Fri 15 Aug 2014 10:35:47 PM UTCcazfiAttached File-=>Added BindAll-2.patch, #21743
      StatusIn Progress=>Ready For Test
    Wed 13 Aug 2014 06:04:29 PM UTCcazfiStatusReady For Test=>In Progress
    Tue 12 Aug 2014 11:58:00 PM UTCcazfiAttached File-=>Added BindAll.patch, #21700
      StatusIn Progress=>Ready For Test
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup