* [IPV6] fix inet6_sk for non IPV6 builds
@ 2004-12-29 22:32 Arnaldo Carvalho de Melo
2004-12-30 8:21 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-12-29 22:32 UTC (permalink / raw)
To: David S. Miller; +Cc: Networking Team, James.Bottomley
[-- Attachment #1: Type: text/plain, Size: 165 bytes --]
Hi David,
Please apply this patch, the problem was noted by James Bottomley, that
doesn't enables CONFIG_IPV6.
Signed-off-by: Arnaldo Carvalho de Melo
- Arnaldo
[-- Attachment #2: inet6_sk.patch --]
[-- Type: text/plain, Size: 648 bytes --]
===== include/linux/ipv6.h 1.23 vs edited =====
--- 1.23/include/linux/ipv6.h 2004-12-27 23:56:33 -02:00
+++ edited/include/linux/ipv6.h 2004-12-29 20:22:45 -02:00
@@ -273,6 +273,7 @@
struct ipv6_pinfo inet6;
};
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
{
return inet_sk(__sk)->pinet6;
@@ -283,7 +284,6 @@
return &((struct raw6_sock *)__sk)->raw6;
}
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
#else
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [IPV6] fix inet6_sk for non IPV6 builds
2004-12-29 22:32 [IPV6] fix inet6_sk for non IPV6 builds Arnaldo Carvalho de Melo
@ 2004-12-30 8:21 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-12-30 8:21 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: davem, netdev, James.Bottomley
Arnaldo Carvalho de Melo <acme@conectiva.com.br> wrote:
>
> Please apply this patch, the problem was noted by James Bottomley, that
> doesn't enables CONFIG_IPV6.
>
> Signed-off-by: Arnaldo Carvalho de Melo
>
> - Arnaldo
>
>
> [inet6_sk.patch text/plain (787 bytes)]
> ===== include/linux/ipv6.h 1.23 vs edited =====
> --- 1.23/include/linux/ipv6.h 2004-12-27 23:56:33 -02:00
> +++ edited/include/linux/ipv6.h 2004-12-29 20:22:45 -02:00
> @@ -273,6 +273,7 @@
> struct ipv6_pinfo inet6;
> };
>
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
> {
> return inet_sk(__sk)->pinet6;
> @@ -283,7 +284,6 @@
> return &((struct raw6_sock *)__sk)->raw6;
> }
>
> -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
> #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
> #else
This breaks selinux:
security/selinux/avc.c: In function `avc_audit':
security/selinux/avc.c:640: warning: implicit declaration of function `inet6_sk'
security/selinux/avc.c:640: warning: initialization makes pointer from integer w
This is hastily tested:
--- 25/include/linux/ipv6.h~fix-inet6_sk-for-non-ipv6-builds 2004-12-30 00:19:06.550680488 -0800
+++ 25-akpm/include/linux/ipv6.h 2004-12-30 00:20:30.386935440 -0800
@@ -273,6 +273,7 @@ struct tcp6_sock {
struct ipv6_pinfo inet6;
};
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
{
return inet_sk(__sk)->pinet6;
@@ -283,10 +284,20 @@ static inline struct raw6_opt * raw6_sk(
return &((struct raw6_sock *)__sk)->raw6;
}
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
#else
+
+static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
+{
+ return NULL;
+}
+
+static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
+{
+ return NULL;
+}
+
#define __ipv6_only_sock(sk) 0
#define ipv6_only_sock(sk) 0
#endif
_
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-12-30 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-29 22:32 [IPV6] fix inet6_sk for non IPV6 builds Arnaldo Carvalho de Melo
2004-12-30 8:21 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).