[OPEN-ILS-DEV] PATCH: socket_bundle[ch] (inet_addr -> inet_aton)

Scott McKellar mck9 at swbell.net
Sun Jul 8 13:03:32 EDT 2007


In this patch:

1. I added the const qualifier to several function parameters.

2. I replaced inet_addr() with inet_aton().

According to the man page, inet_addr() is obsolete.  It reports an 
error by returning -1, which however is a valid IP address 
(255.255.255.255).  inet_aton reports errors in a more robust way.

3. I check the return value from inet_aton().  If the input address is 
invalid, I log a message and return -1.  I used osrfLogWarning(); 
perhaps I should have used osrfLogError().

Without such a check, an invalid listener address leads to a server
that is completely unresponsive.  The user has no way to know what's
wrong unless he spots the mistake himself in the relevant 
configuration file.

Scott McKellar
http://home.swbell.net/mck9/ct/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket_bundle_h_2.patch
Type: text/x-patch
Size: 1898 bytes
Desc: 1342744321-socket_bundle_h_2.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070708/4ed962d5/socket_bundle_h_2.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket_bundle_c_3.patch
Type: text/x-patch
Size: 3078 bytes
Desc: 2652703078-socket_bundle_c_3.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070708/4ed962d5/socket_bundle_c_3.bin


More information about the Open-ils-dev mailing list