From: David Ahern <hidden> Date: 2018-02-16 19:03:11
Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.
Signed-off-by: David Ahern <redacted>
---
net/ipv4/ip_sockglue.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2018-02-16 21:43:18
From: David Ahern <redacted>
Date: Fri, 16 Feb 2018 11:03:03 -0800
Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.
Signed-off-by: David Ahern <redacted>
Ok, this behavior meets reasonable expectations, applied, thanks.
None of the documation is clear about this relationship between
ip_pktinfo's ifindex and settings made by SO_BINDTODEVICE.
From: David Ahern <hidden> Date: 2018-02-16 22:12:11
On 2/16/18 2:43 PM, David Miller wrote:
From: David Ahern <redacted>
Date: Fri, 16 Feb 2018 11:03:03 -0800
quoted
Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.
Signed-off-by: David Ahern <redacted>
Ok, this behavior meets reasonable expectations, applied, thanks.
None of the documation is clear about this relationship between
ip_pktinfo's ifindex and settings made by SO_BINDTODEVICE.
It is my understanding that SO_BINDTODEVICE is the strongest -- it
requires admin to set. From there IP_PKTINFO and IP_UNICAST_IF are
non-root options and hence weaker. If that is the proper expectation,
then the right thing to do is probably to error out if ipc.oif is
already set. I was concerned that would break existing apps, so this
seemed to be a compromise.
From: David Ahern <hidden> Date: 2018-03-06 20:52:08
On 2/16/18 12:03 PM, David Ahern wrote:
Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.
Signed-off-by: David Ahern <redacted>
---
net/ipv4/ip_sockglue.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Dave: Any chance this can get backported to 4.14 and 4.9 stable
releases? Right now, net-snmp is dead in the water with VRF because it
uses IP_PKTINFO to set the source address AND in the process sets the
ifindex to 0 to allow asymmetric routing (request received on one
interface and response goes out a different one). This patch allows 'ip
vrf exec mgmt snmpd' to work.
From: David Miller <davem@davemloft.net> Date: 2018-03-06 21:41:40
From: David Ahern <redacted>
Date: Tue, 6 Mar 2018 13:52:05 -0700
On 2/16/18 12:03 PM, David Ahern wrote:
quoted
Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.
Signed-off-by: David Ahern <redacted>
---
net/ipv4/ip_sockglue.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Dave: Any chance this can get backported to 4.14 and 4.9 stable
releases? Right now, net-snmp is dead in the water with VRF because it
uses IP_PKTINFO to set the source address AND in the process sets the
ifindex to 0 to allow asymmetric routing (request received on one
interface and response goes out a different one). This patch allows 'ip
vrf exec mgmt snmpd' to work.
Ok, I've put this patch into 'net' and will let it soak there, and
also queue it up for a future -stable submission.
Thanks David.