Switch to codeload for simplicity. Signed-off-by: Rosen Penev <rosenp@gmail.com>lilik-openwrt-22.03
@ -1,49 +0,0 @@ | |||
--- a/src/linux/xt_coova.c | |||
+++ b/src/linux/xt_coova.c | |||
@@ -292,6 +292,8 @@ static int coova_mt_check(const struct x | |||
struct coova_table *t; | |||
#ifdef CONFIG_PROC_FS | |||
struct proc_dir_entry *pde; | |||
+ kuid_t uid; | |||
+ kgid_t gid; | |||
#endif | |||
unsigned i; | |||
int ret = 0; | |||
@@ -330,8 +332,9 @@ static int coova_mt_check(const struct x | |||
ret = -ENOMEM; | |||
goto out; | |||
} | |||
- pde->uid = ip_list_uid; | |||
- pde->gid = ip_list_gid; | |||
+ uid = make_kuid(&init_user_ns, ip_list_uid); | |||
+ gid = make_kgid(&init_user_ns, ip_list_gid); | |||
+ proc_set_user(pde, uid, gid); | |||
#endif | |||
spin_lock_bh(&coova_lock); | |||
list_add_tail(&t->list, &tables); | |||
@@ -445,14 +448,13 @@ static const struct seq_operations coova | |||
static int coova_seq_open(struct inode *inode, struct file *file) | |||
{ | |||
- struct proc_dir_entry *pde = PDE(inode); | |||
struct coova_iter_state *st; | |||
st = __seq_open_private(file, &coova_seq_ops, sizeof(*st)); | |||
if (st == NULL) | |||
return -ENOMEM; | |||
- st->table = pde->data; | |||
+ st->table = PDE_DATA(inode); | |||
return 0; | |||
} | |||
@@ -460,8 +462,7 @@ static ssize_t | |||
coova_mt_proc_write(struct file *file, const char __user *input, | |||
size_t size, loff_t *loff) | |||
{ | |||
- const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | |||
- struct coova_table *t = pde->data; | |||
+ struct coova_table *t = PDE_DATA(file->f_path.dentry->d_inode); | |||
struct coova_entry *e; | |||
char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; | |||
const char *c = buf; |
@ -1,28 +0,0 @@ | |||
--- a/src/md5.h | |||
+++ b/src/md5.h | |||
@@ -28,6 +28,14 @@ | |||
#define MD5Update MD5_Update | |||
#define MD5Final MD5_Final | |||
+#elif HAVE_CYASSL | |||
+#include <cyassl/openssl/md5.h> | |||
+ | |||
+#define MD5Init MD5_Init | |||
+#define MD5Update MD5_Update | |||
+#define MD5Final MD5_Final | |||
+ | |||
+typedef struct CYASSL_MD5_CTX MD5_CTX; | |||
#else | |||
struct MD5Context { | |||
--- a/src/md5.c | |||
+++ b/src/md5.c | |||
@@ -18,7 +18,7 @@ | |||
#include <string.h> /* for memcpy() */ | |||
#include "md5.h" | |||
-#ifndef HAVE_OPENSSL | |||
+#if !defined(HAVE_OPENSSL) && !defined(HAVE_CYASSL) | |||
void byteReverse(unsigned char *buf, size_t longs); | |||
@ -1,61 +0,0 @@ | |||
--- a/src/system.h | |||
+++ b/src/system.h | |||
@@ -78,11 +78,6 @@ | |||
#include <sys/stat.h> | |||
#endif | |||
-#ifdef HAVE_LINUX_SYSINFO_H | |||
-#define _LINUX_KERNEL_H | |||
-#include <linux/sysinfo.h> | |||
-#endif | |||
- | |||
#ifdef HAVE_TIME_H | |||
#include <time.h> | |||
#endif | |||
@@ -123,6 +118,11 @@ | |||
#include <signal.h> | |||
#endif | |||
+#ifdef HAVE_SYS_SYSINFO_H | |||
+#define _LINUX_SYSINFO_H | |||
+#include <sys/sysinfo.h> | |||
+#endif | |||
+ | |||
#if defined(__linux__) | |||
#include <asm/types.h> | |||
#include <linux/if.h> | |||
@@ -135,10 +135,6 @@ | |||
#include <linux/un.h> | |||
#endif | |||
-#ifdef HAVE_SYS_SYSINFO_H | |||
-#include <sys/sysinfo.h> | |||
-#endif | |||
- | |||
#elif defined (__FreeBSD__) || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__) | |||
#include <net/if.h> | |||
#include <net/bpf.h> | |||
@@ -170,10 +166,6 @@ | |||
#include <net/if_tun.h> | |||
#endif | |||
-#ifdef HAVE_NET_ETHERNET_H | |||
-#include <net/ethernet.h> | |||
-#endif | |||
- | |||
#ifdef HAVE_ASM_TYPES_H | |||
#include <asm/types.h> | |||
#endif | |||
--- a/src/chilli_limits.h | |||
+++ b/src/chilli_limits.h | |||
@@ -18,8 +18,8 @@ | |||
* | |||
*/ | |||
-#ifndef _LIMITS_H | |||
-#define _LIMITS_H | |||
+#ifndef _CHILLI_LIMITS_H | |||
+#define _CHILLI_LIMITS_H | |||
/* | |||
* extracted from various .h files, needs some cleanup. |
@ -1,31 +0,0 @@ | |||
--- a/src/chilli.c | |||
+++ b/src/chilli.c | |||
@@ -4297,8 +4297,10 @@ static int chilliauth_cb(struct radius_t | |||
while (!differ && r1 > 0 && r2 > 0); | |||
} | |||
- if (newfd) safe_close(newfd); newfd=0; | |||
- if (oldfd) safe_close(oldfd); oldfd=0; | |||
+ if (newfd) safe_close(newfd); | |||
+ newfd=0; | |||
+ if (oldfd) safe_close(oldfd); | |||
+ oldfd=0; | |||
if (differ) { | |||
log_dbg("Writing out new hs.conf file with administraive-user settings"); | |||
--- a/src/redir.c | |||
+++ b/src/redir.c | |||
@@ -3176,9 +3176,11 @@ pid_t redir_fork(int in, int out) { | |||
} | |||
#if defined(F_DUPFD) | |||
- if (fcntl(in,F_GETFL,0) == -1) return -1; safe_close(0); | |||
+ if (fcntl(in,F_GETFL,0) == -1) return -1; | |||
+ safe_close(0); | |||
if (fcntl(in,F_DUPFD,0) == -1) return -1; | |||
- if (fcntl(out,F_GETFL,1) == -1) return -1; safe_close(1); | |||
+ if (fcntl(out,F_GETFL,1) == -1) return -1; | |||
+ safe_close(1); | |||
if (fcntl(out,F_DUPFD,1) == -1) return -1; | |||
#else | |||
if (dup2(in,0) == -1) return -1; |