tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Adding ifam_pid to ifa_msghdr



On 2016-09-16 21:36, christos%astron.com@localhost wrote:
In article <2bb97893-29ae-4eda-2fc7-5ed5bd3d34bb%marples.name@localhost>,
Roy Marples  <roy%marples.name@localhost> wrote:
On 31/08/2016 07:02, Christos Zoulas wrote:
In article <3585331.9LpqSETiX3%uberpc.marples.name@localhost>,
Roy Marples  <roy%marples.name@localhost> wrote:
Hi List!

Unlike rtm_msghdr, ifam_msghdr has no idea of the identity of the
process who
added or deleted an address.

This is important for processes which add/delete addresses while
listening for
3rd parties to add/delete addresses as well, so self generated
messages can be
ignored.

Here is a simple patch which adds ifam_pid to ifa_msghdr so the identity of
the sender is known.
http://www.netbsd.org/~roy/ifam_pid.patch

Unless anyone objects, I will add this soon.

If only it was that simple... See sys/compat/net/if.h how to do it properly.

OK, I have a new patch for this here:
http://www.netbsd.org/~roy/ifam_pid_addrflags.patch

I took the liberty of adding ifam_addrflags while here, so that it can
be added to getifaddrs(3) and both save an extra ioctl per address for
programs like dhcpcd, which also decreases it's binary size.
http://www.netbsd.org/~roy/ifaddrs_addrflags.patch

Comments welcome.

You need to version getifaddrs(3).

Why? I appended to the end of the struct.
This does not break ABI AFAIK, so should work fine with older progs.

Roy


Home | Main Index | Thread Index | Old Index