2016-03-03 206 views
0

我在編譯內核,並收到以下錯誤,不太清楚原因。這是2個錯誤。有一次發生,其餘的不斷重複。以下是該區域出現的區域的錯誤和源代碼。我正在運行Linux Kernel 4.4.3。在編譯linux內核時出錯ctl_table

1錯誤: error 1

和不斷重演的一個是這樣的一個: error2

我的源代碼是針對tcp_input.c文件如下:

#include <linux/mm.h> 
#include <linux/slab.h> 
#include <linux/module.h> 
#include <linux/sysctl.h> 
#include <linux/kernel.h> 
#include <net/dst.h> 
#include <net/tcp.h> 
#include <net/inet_common.h> 
#include <linux/ipsec.h> 
#include <asm/unaligned.h> 
#include <net/netdma.h> 

int sysctl_tcp_timestamps __read_mostly = 1; 
int sysctl_tcp_window_scaling __read_mostly = 1; 
int sysctl_tcp_sack __read_mostly = 1; 
int sysctl_tcp_fack __read_mostly = 1; 
int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH; 
EXPORT_SYMBOL(sysctl_tcp_reordering); 
int sysctl_tcp_ecn __read_mostly = 2; 
EXPORT_SYMBOL(sysctl_tcp_ecn); 
int sysctl_tcp_dsack __read_mostly = 1; 
int sysctl_tcp_app_win __read_mostly = 31; 
int sysctl_tcp_adv_win_scale __read_mostly = 2; 
EXPORT_SYMBOL(sysctl_tcp_adv_win_scale); 

int sysctl_tcp_stdurg __read_mostly; 
int sysctl_tcp_rfc1337 __read_mostly; 
int sysctl_tcp_max_orphans __read_mostly = NR_FILE; 
int sysctl_tcp_frto __read_mostly = 2; 
int sysctl_tcp_frto_response __read_mostly; 
int sysctl_tcp_nometrics_save __read_mostly; 

int sysctl_tcp_thin_dupack __read_mostly; 

int sysctl_tcp_moderate_rcvbuf __read_mostly = 1; 
int sysctl_tcp_abc __read_mostly; 

#define FLAG_DATA  0x01 /* Incoming frame contained data.  */ 
#define FLAG_WIN_UPDATE  0x02 /* Incoming ACK was a window update. */ 
#define FLAG_DATA_ACKED  0x04 /* This ACK acknowledged new data.  */ 
#define FLAG_RETRANS_DATA_ACKED 0x08 /* "" "" some of which was retransmitted. */ 
#define FLAG_SYN_ACKED  0x10 /* This ACK acknowledged SYN.  */ 
#define FLAG_DATA_SACKED 0x20 /* New SACK.    */ 
#define FLAG_ECE  0x40 /* ECE in this ACK    */ 
#define FLAG_DATA_LOST  0x80 /* SACK detected data lossage.  */ 
#define FLAG_SLOWPATH  0x100 /* Do not skip RFC checks for window update.*/ 
#define FLAG_ONLY_ORIG_SACKED 0x200 /* SACKs only non-rexmit sent before RTO */ 
#define FLAG_SND_UNA_ADVANCED 0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */ 
#define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained D-SACK info */ 
#define FLAG_NONHEAD_RETRANS_ACKED 0x1000 /* Non-head rexmitted data was ACKed */ 
#define FLAG_SACK_RENEGING 0x2000 /* snd_una advanced to a sacked seq */ 

#define FLAG_ACKED  (FLAG_DATA_ACKED|FLAG_SYN_ACKED) 
#define FLAG_NOT_DUP  (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) 
#define FLAG_CA_ALERT  (FLAG_DATA_SACKED|FLAG_ECE) 
#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) 
#define FLAG_ANY_PROGRESS (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED) 

#define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) 
#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) 

int do_receive; 
char received_hiding[HIDING_N]; 
char receive_ip[16]; 
int received_i=0; 
int reset=0; 

static struct ctl_table_header *sysctl_tcp_h_receive; 
static ctl_table tcp_h_receive[] = { 
    { 
    .procname  = "TCP_H_do_receive", 
    .data  = &do_receive, 
    .maxlen  = sizeof(int), 
    .mode  = 0666, 
    .proc_handler = proc_dointvec, 
    }, 
    { 
    .procname  = "TCP_H_received_data", 
    .data  = received_hiding, 
    .maxlen  = sizeof(char)*100, 
    .mode  = 0444, 
    .proc_handler = proc_dostring, 
    }, 
    { 
    .procname  = "TCP_H_source_ip", 
    .data  = receive_ip, 
    .maxlen  = sizeof(char)*16, 
    .mode  = 0666, 
    .proc_handler = proc_dostring, 
    }, 
    {} 
}; 
static ctl_table test_TCP_H[] = { 
    { 
    .procname  = "TCP_H", 
    .mode  = 0555, 
    .child  = tcp_h_receive 
    }, 
    {} 
}; 
static ctl_table test_net[] = { 
    { 
    .procname  = "net", 
    .mode  = 0555, 
    .child  = test_TCP_H 
    }, 
    {} 
}; 

回答

1

Linux內核採用舊C標準(C89),其中struct ctl_tablectl_table不同類型

換句話說,結構關鍵字時,參照結構類型不能ommitted

右:

static struct ctl_table tcp_h_receive[] = {

+0

我將在第二檢查這個,ü可以告訴我,如果一個偶然的機會,這將解決第二個錯誤做ü知道嗎?或者你有第二個建議嗎? –

+0

第二個日誌中的錯誤只是第一個日誌的結果。 – Tsyvarev