-
Ken Zhu authored
fix the issues that api was rename and structure was changed Change-Id: I8ecf9cfaa914ab58960aeaddb2a757c454a4a4d1 Signed-off-by:
Ken Zhu <guigenz@codeaurora.org>
5104f041
305-linux-5.4-compatible.patch 18.12 KiB
diff -Nur a/linux/include/des/des_locl.h openswan-2.6.51.3/linux/include/des/des_locl.h
--- a/linux/include/des/des_locl.h 2020-07-24 13:51:39.448023887 -0700
+++ openswan-2.6.51.3/linux/include/des/des_locl.h 2020-07-24 13:53:42.387414966 -0700
@@ -188,7 +188,11 @@
#define ITERATIONS 16
#define HALF_ITERATIONS 8
-
+#if __has_attribute(__fallthrough__)
+#define FALLTHROUGH __attribute__((__fallthrough__))
+#else
+#define FALLTHROUGH
+#endif
/* used in des_read and des_write */
#define MAXWRITE (1024*16)
#define BSIZE (MAXWRITE+4)
@@ -203,14 +207,14 @@
c+=n; \
l1=l2=0; \
switch (n) { \
- case 8: l2 =((DES_LONG)(*(--(c))))<<24L; \
- case 7: l2|=((DES_LONG)(*(--(c))))<<16L; \
- case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; \
- case 5: l2|=((DES_LONG)(*(--(c)))); \
- case 4: l1 =((DES_LONG)(*(--(c))))<<24L; \
- case 3: l1|=((DES_LONG)(*(--(c))))<<16L; \
- case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; \
- case 1: l1|=((DES_LONG)(*(--(c)))); \
+ case 8: l2 =((DES_LONG)(*(--(c))))<<24L; FALLTHROUGH; \
+ case 7: l2|=((DES_LONG)(*(--(c))))<<16L; FALLTHROUGH; \
+ case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; FALLTHROUGH; \
+ case 5: l2|=((DES_LONG)(*(--(c)))); FALLTHROUGH; \
+ case 4: l1 =((DES_LONG)(*(--(c))))<<24L; FALLTHROUGH; \
+ case 3: l1|=((DES_LONG)(*(--(c))))<<16L; FALLTHROUGH; \
+ case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; FALLTHROUGH; \
+ case 1: l1|=((DES_LONG)(*(--(c)))); FALLTHROUGH; \
} \
}
@@ -237,14 +241,14 @@
#define l2cn(l1,l2,c,n) { \
c+=n; \
switch (n) { \
- case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
- case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
- case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
- case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
- case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
- case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
- case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
- case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
+ case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); FALLTHROUGH;\
+ case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); FALLTHROUGH;\
+ case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); FALLTHROUGH;\
+ case 5: *(--(c))=(unsigned char)(((l2) )&0xff); FALLTHROUGH;\
+ case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); FALLTHROUGH;\
+ case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); FALLTHROUGH;\
+ case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); FALLTHROUGH;\
+ case 1: *(--(c))=(unsigned char)(((l1) )&0xff); FALLTHROUGH;\
} \
}
diff -Nur a/linux/include/openswan/ipsec_kversion.h openswan-2.6.51.3/linux/include/openswan/ipsec_kversion.h
--- a/linux/include/openswan/ipsec_kversion.h 2020-07-24 13:51:39.448023887 -0700
+++ openswan-2.6.51.3/linux/include/openswan/ipsec_kversion.h 2020-07-24 13:52:17.599835508 -0700
@@ -161,7 +161,9 @@
#endif
/* how to reset an skb we are reusing after encrpytion/decryption etc */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)