Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a96fb49be3dd2031f722bf32af6ed7db965b60f7
Commit:     a96fb49be3dd2031f722bf32af6ed7db965b60f7
Parent:     36d98d3edce12c8f9ffd33f8f5d23ce728380925
Author:     Flavio Leitner <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 24 22:16:39 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sun Aug 26 18:35:35 2007 -0700

    [NET]: Fix IP_ADD/DROP_MEMBERSHIP to handle only connectionless
    
    Fix IP[V6]_ADD_MEMBERSHIP and IP[V6]_DROP_MEMBERSHIP to
    return -EPROTO for connection oriented sockets.
    
    Signed-off-by: Flavio Leitner <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/ip_sockglue.c   |    4 ++++
 net/ipv6/ipv6_sockglue.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 4d54457..6b420ae 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -625,6 +625,10 @@ static int do_ip_setsockopt(struct sock *sk, int level,
        {
                struct ip_mreqn mreq;
 
+               err = -EPROTO;
+               if (inet_sk(sk)->is_icsk)
+                       break;
+
                if (optlen < sizeof(struct ip_mreq))
                        goto e_inval;
                err = -EFAULT;
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 761a910..6b038aa 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -554,6 +554,10 @@ done:
        {
                struct ipv6_mreq mreq;
 
+               retv = -EPROTO;
+               if (inet_sk(sk)->is_icsk)
+                       break;
+
                retv = -EFAULT;
                if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq)))
                        break;
-
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