Skip to contentSkip to conversation

: Compilation fix for compat MCAST_MSFILTER sockopts.

PATCH Applied Pavel Emelyanov 3 participants 3 messages Apr 30, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Compilation fix for compat MCAST_MSFILTER sockopts.

The last hunk from the commit dae50295 (ipv4/ipv6 compat: Fix SSM applications on 64bit kernels.) escaped from the compat_ipv6_setsockopt to the ipv6_getsockopt (I guess due to patch smartness wrt searching for context) thus breaking 32-bit and 64-bit-without-compat compilation.

---

net/ipv6/ipv6_sockglue.c +4 -4
index b4a26f2..56d55fe 100644
@@ -1089,10 +1089,6 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
 	if(level != SOL_IPV6)
 		return -ENOPROTOOPT;
 
-	if (optname == MCAST_MSFILTER)
-		return compat_mc_getsockopt(sk, level, optname, optval, optlen,
-			ipv6_getsockopt);
-
 	err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
 	/* we need to exclude all possible ENOPROTOOPTs except default case */
@@ -1131,6 +1127,10 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
 	if (level != SOL_IPV6)
 		return -ENOPROTOOPT;
 
+	if (optname == MCAST_MSFILTER)
+		return compat_mc_getsockopt(sk, level, optname, optval, optlen,
+			ipv6_getsockopt);
+
 	err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
 	/* we need to exclude all possible ENOPROTOOPTs except default case */
Acked-by on v1 1/1
#1 lore raw

Pavel,
Definitely should be in compat_ipv6_getsockopt() as the original was-- I hope
your patch doesn't do the same thing when applied!

Good catch!

                                                        +-DLS

[email protected] wrote on 04/30/2008 06:36:31 AM:

net/ipv6/ipv6_sockglue.c int ipv6_getsockopt(struct sock *sk, int level,

Quoted 14 lines

The last hunk from the commit dae50295 (ipv4/ipv6 compat: Fix SSM applications on 64bit kernels.) escaped from the compat_ipv6_setsockopt to the ipv6_getsockopt (I guess due to patch smartness wrt searching for context) thus breaking 32-bit and 64-bit-without-compat compilation.

---

net/ipv6/ipv6_sockglue.c +0 -0
index b4a26f2..56d55fe 100644
@@ -1089,10 +1089,6 @@ int ipv6_getsockopt(struct sock *sk, int level, 

int optname,

net/ipv6/ipv6_sockglue.c int ipv6_getsockopt(struct sock *sk, int level, int optname,

Quoted 10 lines
net/ipv6/ipv6_sockglue.c +0 -4
    if(level != SOL_IPV6)
       return -ENOPROTOOPT;
 
-   if (optname == MCAST_MSFILTER)
-      return compat_mc_getsockopt(sk, level, optname, optval, optlen,
-         ipv6_getsockopt);
-
    err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
    /* we need to exclude all possible ENOPROTOOPTs except default case 

*/

net/ipv6/ipv6_sockglue.c int compat_ipv6_getsockopt(struct sock *sk, int

Quoted 1 line
net/ipv6/ipv6_sockglue.c +0 -0
@@ -1131,6 +1127,10 @@ int compat_ipv6_getsockopt(struct sock *sk, int 

level,

Quoted 11 lines
net/ipv6/ipv6_sockglue.c +4 -0
 int optname,
    if (level != SOL_IPV6)
       return -ENOPROTOOPT;
 
+   if (optname == MCAST_MSFILTER)
+      return compat_mc_getsockopt(sk, level, optname, optval, optlen,
+         ipv6_getsockopt);
+
    err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
 #ifdef CONFIG_NETFILTER
    /* we need to exclude all possible ENOPROTOOPTs except default case 

*/

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#2 lore raw

From: David Stevens <[email protected]>
Date: Wed, 30 Apr 2008 07:26:29 -0700

Quoted 9 lines

Pavel,
Definitely should be in compat_ipv6_getsockopt() as the original was-- I hope
your patch doesn't do the same thing when applied!

Good catch!

                                                        +-DLS

Applied, thanks guys.