Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 318905 - [PATCH] Make ez-ipupdate work with iproute2/dhcpcd under linux
Summary: [PATCH] Make ez-ipupdate work with iproute2/dhcpcd under linux
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Stefan Briesenick (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 19:55 UTC by Martin Väth
Modified: 2010-07-20 20:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Use kernel address table under linux (ez-ipupdate-linux.diff,4.45 KB, patch)
2010-05-07 19:56 UTC, Martin Väth
Details | Diff
Use local ip instead of point-to-point destination (ez-ipupdate-linux.diff,4.45 KB, patch)
2010-05-09 20:02 UTC, Martin Väth
Details | Diff
Reopen socket for every query (ez-ipupdate-linux.diff,5.50 KB, patch)
2010-05-20 06:30 UTC, Martin Väth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Väth 2010-05-07 19:55:19 UTC
I attach the patch which in case of linux systems reads the IP address from
the kernel table instead of the ioctl(SIOCGIFADDR) mechanism.

This is needed for usage with dhcpcd, since the latter associates several IPs
to the interface, and the desired IP is usually not the first one.

The patch uses the last IP for the interface; private IPs (like 192.168.*.*)
are ignored.
Comment 1 Martin Väth 2010-05-07 19:56:06 UTC
Created attachment 230735 [details, diff]
Use kernel address table under linux
Comment 2 Martin Väth 2010-05-09 20:02:45 UTC
Created attachment 230895 [details, diff]
Use local ip instead of point-to-point destination

Since I had now an opportunity to test the patch also with pppd, I found that
ifconfig reports the local ip instead of the point-to-point destination ip.

So in order not to break previous functionality, the patch now also uses
IFA_LOCAL insead of IFA_ADDR.
Comment 3 Martin Väth 2010-05-20 06:30:51 UTC
Created attachment 232193 [details, diff]
Reopen socket for every query

After doing some long-time tests, I found that the linux kernel gets confused
if one keeps the netlink socket open permanently.
So (under linux) the socket is now opened/closed for every netlink query.
This is slightly slower but needs less permanent resources and appears to
work reliable.
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2010-07-20 20:31:45 UTC
new revision with your patch in CVS. Many thanks!