From: Erich E. Hoover <hidden> Date: 2012-02-06 19:35:29
On Mon, Feb 6, 2012 at 12:00 PM, Shawn Lu [off-list ref] wrote:
On 2/6/12, Erich E. Hoover [off-list ref] wrote:
quoted
...
+ if (sk->sk_bound_dev_if && ifindex != sk->sk_bound_dev_if)
If I understand right, when sk->sk_bound_dev_if !=0 , sk->sk_bound_dev_if
will be used instead. Then why bother to set outif_index.
Here.
It seems to me that if the socket is already bound to an interface
(other than intended interface) then it makes sense to fail to set the
option, since it will clearly not work under this circumstance. I may
be misunderstanding you though.
Erich Hoover
ehoover@mines.edu
-----Original Message-----
From: Erich E. Hoover [mailto:ehoover@mines.edu]
Sent: Monday, February 06, 2012 11:35 AM
To: Shawn Lu
Cc: Linux Netdev
Subject: Re: [PATCH v3 1/2] Implement IP_UNICAST_IF socket option.
On Mon, Feb 6, 2012 at 12:00 PM, Shawn Lu
[off-list ref] wrote:
quoted
On 2/6/12, Erich E. Hoover [off-list ref] wrote:
quoted
...
+ if (sk->sk_bound_dev_if && ifindex !=
+ sk->sk_bound_dev_if)
If I understand right, when sk->sk_bound_dev_if !=0 ,
sk->sk_bound_dev_if will be used instead. Then why bother
to set outif_index.
quoted
Here.
It seems to me that if the socket is already bound to an
interface (other than intended interface) then it makes sense
to fail to set the option, since it will clearly not work
under this circumstance. I may be misunderstanding you though.
What I mean is replace
if (sk->sk_bound_dev_if && ifindex != sk->sk_bound_dev_if)
With
if (sk->sk_bound_dev_if)
-----Original Message-----
From: Erich E. Hoover [mailto:ehoover@mines.edu]
Sent: Monday, February 06, 2012 11:51 AM
To: Shawn Lu
Cc: Linux Netdev
Subject: Re: [PATCH v3 1/2] Implement IP_UNICAST_IF socket option.
On Mon, Feb 6, 2012 at 12:40 PM, Shawn Lu
[off-list ref] wrote:
quoted
...
What I mean is replace
if (sk->sk_bound_dev_if && ifindex != sk->sk_bound_dev_if) With
if (sk->sk_bound_dev_if)
Are you sure that that's appropriate? I choose to do it this
way since IP_MULTICAST_IF does the exact same check.
If sk->sk_bound_dev_if has a value, we are not going to use
outif_index anywhere. Seting outif_index is confusing in this case,
In addition, when socket has bond to specific device, this
Option should return fail to indicate it is wrong to use IP_UNICAST_IF
Here.
From: Erich E. Hoover <hidden> Date: 2012-02-06 22:14:57
On Mon, Feb 6, 2012 at 1:30 PM, Shawn Lu [off-list ref] wrote:
...
If sk->sk_bound_dev_if has a value, we are not going to use
outif_index anywhere. Seting outif_index is confusing in this case,
In addition, when socket has bond to specific device, this
Option should return fail to indicate it is wrong to use IP_UNICAST_IF
Here.