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

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

This is an automatically generated e-mail. To reply, visit:

Review request for kdelibs.


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.




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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list