iptables 컴파일 에러 도무지 모르겠습니다
글쓴이: raphael4 / 작성시간: 월, 2013/12/02 - 11:30오전
extensions/libipt_REJECT.c In function 'parse';
extenstions/libipt_REJECT.c:116:error: label at end of compound statement
iptables1.2 버전 컴파일 하는데 위와 같이 에러가 나옵니다
make KERNEL_DIR=/home/linux-2.6.30.1
이렇게 make 하고
커널에 iptables 관련 사항 다 넣고 빌드 했습니다
저 에러는 구글링 해도 전혀 정보가 없더군요
조금이나마 힌트라도 부탁드립니다.
Forums:
설치하시는 환경이 어떻게
설치하시는 환경이 어떻게 되시나요?
iptables-1.2 버전으로 확인을 했습니다.
아마도 gcc 버전 문제로 분석됩니다. gcc에서 예전에는 허용했던 구문 오류가 버전업이 되면서 오류로 잡아내는 현상입니다.
extension/libipt_REJECT.c 파일에서 다음의 내용을 확인했습니다.
89 static int
90 parse(int c, char **argv, int invert, unsigned int *flags,
91 const struct ipt_entry *entry,
92 struct ipt_entry_target **target)
93 {
94 struct ipt_reject_info *reject = (struct ipt_reject_info *)(*target)->data;
95 unsigned int limit = sizeof(reject_table)/sizeof(struct reject_names);
96 unsigned int i;
97
98 switch(c) {
99 case '1':
100 if (check_inverse(optarg, &invert))
101 exit_error(PARAMETER_PROBLEM,
102 "Unexpected `!' after --reject-with");
103 for (i = 0; i < limit; i++) {
104 if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0)
105 || (strncasecmp(reject_table[i].alias, optarg, strlen(optarg)) == 0)) {
106 reject->with = reject_table[i].with;
107 return 1;
108 }
109 }
110 /* This due to be dropped late in 2.4 pre-release cycle --RR */
111 if (strncasecmp("echo-reply", optarg, strlen(optarg)) == 0
112 || strncasecmp("echoreply", optarg, strlen(optarg)) == 0)
113 fprintf(stderr, "--reject-with echo-reply no longer"
114 " supported\n");
115 exit_error(PARAMETER_PROBLEM, "unknown reject type `%s'",optarg);
116 default:
117 /* Fall through */
118 }
119 return 0;
120 }
116번째 라인 default: 다음에 바로 } switch 종료 구문이 옵니다.
이는 gcc-3.0 이후부터는 허용되지 않는 구문입니다. 최신의 iptables 를 설치하시거나 gcc-3.0 이전의 버전으로 컴파일하시거나 혹은 116번째 라인 밑에 한줄 추가하셔서 ';' 세미콜론을 넣어주시면 문제가 해결될 것으로 보입니다.
Ref: https://bbs.archlinux.org/viewtopic.php?pid=30177
---------------------------------
제일 왼쪽이 저입니다 :)
감사합니다
컴파일 정상적으로 됩니다
make install이 안되는 문제가 또 발생했지만...
아무튼 감사합니다.
댓글 달기