Subject: Re: [PATCH] net: Fix IP_UNICAST_IF option behavior for connected sockets

From: Richard Gobert <[email-masked]>
Date: Tue, 5 Jul 2022 17:50:29 +0200

On Tue, Jun 28, 2022 at 03:08:48PM +0200, Paolo Abeni wrote:
> This also changes a long-established behavior for such socket option.
> It can break existing application assuming connect() is not affected by
> IP_UNICAST_IF. I'm unsure we can accept it.

The IP_UNICAST_IF option was initially introduced for better compatibility
with the matching Windows socket-option. Its goal was better support for
wine applications.
This patch improves the compatibility even further since Windows behaves
this way for connect()ed sockets.

Also, I have not been able to find any examples of Linux applications
that use IP_UNICAST_IF with connect(). It would be quite confusing to use
this sockopt and expect that it would not affect your socket.
I think that unless someone finds an example of such a use case, then it
is better to accept this patch to improve compatibility for applications
that run with wine.

What are your thoughts on this?

Regards,
Richard