RE: [PATCH v3 1/2] Implement IP_UNICAST_IF socket option.
From: Shawn Lu <hidden>
Date: 2012-02-06 19:40:37
-----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 botherto 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)
Erich Hoover ehoover@mines.edu