-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make error #5
Comments
Looks like your compiler default to C89/C90 standard. Adding I've changed the CFLAGS in Makefile - you should be able to compile it now. Please pull the latest code and try again. |
I did some changes in the eoip.c and build was successful #include "eoip.h" // set name of the caller, inspired from nginx's ngx_setproctitle.c int i; size_t size = 0; for (i = 0; dst[i]; i++) size += strlen(dst[i]) + 1; dst[1] = NULL; int main (int argc, char** argv) { if (argc < 2) { // assume that the first argument is IFNAME // parse some args
for(i = 1; i < argc; i++) { // fork to background? // build sockaddr for send/recv. // bind a sock // bind a tap interface // change UID/GID? fprintf(stderr, "[INFO] attached to %s, mode %s, remote %s, local %s, tid %d, mtu %d.\n", ifname, af == AF_INET6 ? "EoIPv6" : "EoIP", dst, src, tid, mtu); // all set, let's get to work. do { |
BTW, tunnel with mikrotik not working eoip -4 tap1 local 10.0.0.2 remote 10.0.0.1 id 100 |
Your fix still returns errors with make: root@st:~/eoip# make |
And with my variant of eoip.c (without -std=c99) it's OK: root@st:~/eoip# make |
Could you provide more information about your tunneling setup? (e.g. Firewall rules, src/dst of the tunnel on MikroTik, etc.) I was able to make tunneling with MikroTik works without problem. Here's my configuration:
Not sure why but your environment seems to be missing |
Just found out that |
Thanks, I'll try later and give feedback |
make is works with -std=gnu99, but eopi is not MikroTik debian I will try on the other Linux host later |
Linux cannot respond to MikroTik keep-alive packet by itself. You can disable keepalive or try use https://github.com/Jamesits/linux-gre-keepalive |
Linux 4.4.134-1-pve #1 SMP PVE 4.4.134-112 (Thu, 05 Jul 2018 12:39:16 +0000) x86_64 GNU/Linux
~/eoip# make
cc -c -o eoip.o eoip.c -O3 -Wall
eoip.c: In function ‘setprocname’:
eoip.c:8:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; environ[i]; i++) size += strlen(environ[i]) + 1;
^
eoip.c:8:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
eoip.c:11:12: error: redefinition of ‘i’
for (int i = 0; dst[i]; i++) size += strlen(dst[i]) + 1;
^
eoip.c:8:12: note: previous definition of ‘i’ was here
for (int i = 0; environ[i]; i++) size += strlen(environ[i]) + 1;
^
eoip.c:11:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; dst[i]; i++) size += strlen(dst[i]) + 1;
^
eoip.c: In function ‘main’:
eoip.c:38:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for(int i = 1; i < argc; i++) {
^
Makefile:8: recipe for target 'eoip.o' failed
make: *** [eoip.o] Error 1
The text was updated successfully, but these errors were encountered: