Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4953f0fcc06a125f87874743d968c0e185c8b296
Commit:     4953f0fcc06a125f87874743d968c0e185c8b296
Parent:     73aaf9355b71d295fd72dc0b93fcdd275c56648f
Author:     Brian Haley <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 14:39:29 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 14:39:29 2007 -0700

    [IPv6]: Update setsockopt(IPV6_MULTICAST_IF) to support RFC 3493, try2
    
     From RFC 3493, Section 5.2:
    
           IPV6_MULTICAST_IF
    
              Set the interface to use for outgoing multicast packets.  The
              argument is the index of the interface to use.  If the
              interface index is specified as zero, the system selects the
              interface (for example, by looking up the address in a routing
              table and using the resulting interface).
    
    This patch adds support for (index == 0) to reset the value to it's
    original state, allowing the system to choose the best interface.  IPv4
    already behaves this way.
    
    Signed-off-by: Brian Haley <[EMAIL PROTECTED]>
    Acked-by: David L Stevens <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv6/ipv6_sockglue.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 532425d..1334fc1 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -539,12 +539,15 @@ done:
        case IPV6_MULTICAST_IF:
                if (sk->sk_type == SOCK_STREAM)
                        goto e_inval;
-               if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val)
-                       goto e_inval;
 
-               if (__dev_get_by_index(&init_net, val) == NULL) {
-                       retv = -ENODEV;
-                       break;
+               if (val) {
+                       if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val)
+                               goto e_inval;
+
+                       if (__dev_get_by_index(&init_net, val) == NULL) {
+                               retv = -ENODEV;
+                               break;
+                       }
                }
                np->mcast_oif = val;
                retv = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to