summaryrefslogtreecommitdiffstats
path: root/main/iscsitarget-grsec/iscsitarget-0.4.17+linux-2.6.29.patch
blob: 092fdc3fd9c445254d6f434f71dca60385926531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 81373580a641732a7e4610c3d39af0c68007b892 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
Date: Wed, 25 Mar 2009 16:14:46 +0100
Subject: [PATCH 2/2] Fix building with Linux kernel 2.6.29 and later.

When building for Linux 2.6.29 or later, instead of using the NIP6
macro (that has been removed) use the new %p6 format specifier.
---
 kernel/conn.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/conn.c b/kernel/conn.c
index f96e2b6..ab561f9 100644
--- a/kernel/conn.c
+++ b/kernel/conn.c
@@ -6,6 +6,7 @@
 
 #include <linux/file.h>
 #include <linux/ip.h>
+#include <linux/version.h>
 #include <net/tcp.h>
 
 #include "iscsi.h"
@@ -47,8 +48,13 @@ void conn_info_show(struct seq_file *seq, struct iscsi_session *session)
 			break;
 		case AF_INET6:
 			snprintf(buf, sizeof(buf),
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+				 "[%p6]",
+				 &(inet6_sk(sk)->daddr));
+#else
 				 "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]",
 				 NIP6(inet6_sk(sk)->daddr));
+#endif
 			break;
 		default:
 			break;
-- 
1.6.2