Re: [PATCH] net: Keep interface binding when sending packets withipi_ifindex = 0

From: David Miller
Date: Tue Aug 04 2009 - 14:57:01 EST


From: Chia-chi Yeh (葉家齊) <chiachi@xxxxxxxxxxx>
Date: Tue, 4 Aug 2009 15:36:46 +0800

> After thinking more deeply, I believe that IPv6 does the right thing
> and IPv4 does not. SO_BINDTODEVICE requires CAP_NET_RAW, so it is a
> privileged operation. Therefore, it looks weird to me if one can
> specify other interface than the bound one without the same
> capability. The following patch makes the behavior in IPv4 and IPv6
> identical. Thanks for your help.

I think we really cannot change behavior here. If the user specifies
"0" in ipi_ifindex we must respect that in ipc->oif. This is an
override, and the ability to override is the very purpose of this
control message.

Even GLIBC makes use of that case of specifying "0" in ipi_ifindex.
We must respect it.

I'm not applying any of these patches, sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/