Review Request: PATCH: Use 'getifaddrs' instead of 'gethostname+gethostbyname' in kpac_dhcp_helper

Dawit Alemayehu adawit at kde.org
Mon Mar 28 21:53:28 BST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100964/
-----------------------------------------------------------

Review request for kdelibs.


Summary
-------

The kpac_dhcp_helper, the helper program used by KIO to query a DHCP server for Proxy Auto Configuration (PAC), needs to find the host's IP address in order to properly construct a DHCPINFORM query. Currently it uses gethostname()+gethostbyname() to do that, but it is apparent that using the afforementioned system calls is not all that reliable in parctise. 

As such, this patch is an attempt to address the above problem by using the getiffaddrs system call instead. In addition to converting the system call, the patch also attempts to deal with the issue of a multi-homed system by sending the query through each of the valid network interfaces until it obtains a pac file or fails.


Diffs
-----


Diff: http://git.reviewboard.kde.org/r/100964/diff


Testing
-------

I have not personally tested this change and need someone who has a DHCP server setup for this purpose to test it and provide feedback.


Thanks,

Dawit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110328/873f4626/attachment.htm>


More information about the kde-core-devel mailing list