2002-12-04 18:23:47

by Roland Dreier

[permalink] [raw]
Subject: rtnetlink replacement for SIOCSIFHWADDR

Hi, since you are the architects of the rtnetlink facility, I am
writing to you to ask your opinion on how to add some functionality.

I'm exploring what changes are needed in the kernel to support devices
with large addr_len. My motivation is to get the infrastructure for
IP-over-InfiniBand, which has addr_len 20, into the kernel, and I am
trying to produce a patch that can be accepted into mainline 2.5.

With a few a minor fixes to avoid overrunning array bounds, almost
everything just works. The RTM_NEWNEIGH and RTM_DELNEIGH messages
seem to provide what is needed to manage ARP entries with large L2
addresses (replacing the SIOCSARP and SIOCDARP ioctls).

The one major piece that is missing is a replacement for SIOCSIFHWADDR
(which can only set L2 addresses up to 14 bytes long, because of the
size of sa_data in struct sockaddr). I can see two ways one might set
an interface's L2 address through rtnetlink:

We could extend the RTM_NEWLINK message (possibly using the change
mask) to include changing just the L2 address, and add support in
the kernel for receiving these messages from userspace.

Or, we could add a new RTM_SETLINK message that userspace can send
to the kernel to modify an interface's properties.

Of course I am open to other suggestions for how to replace
SIOCSIFHWADDR. I would very much appreciate your thoughts on how to
proceed.

Thanks,
Roland <[email protected]>


2002-12-04 20:04:20

by Andi Kleen

[permalink] [raw]
Subject: Re: rtnetlink replacement for SIOCSIFHWADDR

> Or, we could add a new RTM_SETLINK message that userspace can send
> to the kernel to modify an interface's properties.

Defining a RTM_SETLINK would seem to be cleanest to me.

-Andi