Re: [PATCH] net: Keep interface binding when sending packets with ipi_ifindex = 0
From: David Miller <davem@davemloft.net>
Date: 2009-08-04 18:56:54
Also in:
lkml
From: David Miller <davem@davemloft.net>
Date: 2009-08-04 18:56:54
Also in:
lkml
From: Chia-chi Yeh (葉家齊) <redacted> 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.