Giter Club home page Giter Club logo

Comments (8)

rofl0r avatar rofl0r commented on July 22, 2024

thanks for your report.
i hope the commit i just made fixes it.

from microsocks.

jimmy-ly00 avatar jimmy-ly00 commented on July 22, 2024

Unfortunately, I am still getting the same errors

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

that is weird, i developed the patch on a glibc system (albeit an ancient one) and it worked there. are you certain you pulled the patch ?

from microsocks.

jimmy-ly00 avatar jimmy-ly00 commented on July 22, 2024

Yes positive, here is the error, they just shifted down some lines. What OS are you using?

root@kali:~/microsocks# make
cc  -Wall -std=c99   -c -o server.o server.c
In file included from server.c:1:0:
server.h:26:59: warning: ‘struct addrinfo’ declared inside parameter list will not be visible outside of this definition or declaration
 int resolve(const char *host, unsigned short port, struct addrinfo** addr);
                                                           ^~~~~~~~
server.c:5:59: warning: ‘struct addrinfo’ declared inside parameter list will not be visible outside of this definition or declaration
 int resolve(const char *host, unsigned short port, struct addrinfo** addr) {
                                                           ^~~~~~~~
server.c:5:5: error: conflicting types for ‘resolve’
 int resolve(const char *host, unsigned short port, struct addrinfo** addr) {
     ^~~~~~~
In file included from server.c:1:0:
server.h:26:5: note: previous declaration of ‘resolve’ was here
 int resolve(const char *host, unsigned short port, struct addrinfo** addr);
     ^~~~~~~
server.c: In function ‘resolve’:
server.c:6:9: error: variable ‘hints’ has initializer but incomplete type
  struct addrinfo hints = {
         ^~~~~~~~
server.c:7:3: error: unknown field ‘ai_family’ specified in initializer
   .ai_family = AF_UNSPEC,
   ^
server.c:8:3: error: unknown field ‘ai_socktype’ specified in initializer
   .ai_socktype = SOCK_STREAM,
   ^
server.c:9:3: error: unknown field ‘ai_flags’ specified in initializer
   .ai_flags = AI_PASSIVE,
   ^
server.c:9:15: error: ‘AI_PASSIVE’ undeclared (first use in this function)
   .ai_flags = AI_PASSIVE,
               ^~~~~~~~~~
server.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
server.c:9:15: warning: excess elements in struct initializer
server.c:9:15: note: (near initialization for ‘hints’)
server.c:6:18: error: storage size of ‘hints’ isn’t known
  struct addrinfo hints = {
                  ^~~~~
server.c:13:9: warning: implicit declaration of function ‘getaddrinfo’ [-Wimplicit-function-declaration]
  return getaddrinfo(host, port_buf, &hints, addr);
         ^~~~~~~~~~~
server.c:6:18: warning: unused variable ‘hints’ [-Wunused-variable]
  struct addrinfo hints = {
                  ^~~~~
server.c: In function ‘server_setup’:
server.c:23:29: warning: passing argument 3 of ‘resolve’ from incompatible pointer type [-Wincompatible-pointer-types]
  if(resolve(listenip, port, &ainfo)) return -1;
                             ^
server.c:5:5: note: expected ‘struct addrinfo **’ but argument is of type ‘struct addrinfo **’
 int resolve(const char *host, unsigned short port, struct addrinfo** addr) {
     ^~~~~~~
server.c:26:25: error: dereferencing pointer to incomplete type ‘struct addrinfo’
  for(p = ainfo; p; p = p->ai_next) {
                         ^~
server.c:39:2: warning: implicit declaration of function ‘freeaddrinfo’ [-Wimplicit-function-declaration]
  freeaddrinfo(ainfo);
  ^~~~~~~~~~~~
server.c: In function ‘resolve’:
server.c:14:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:28: recipe for target 'server.o' failed
make: *** [server.o] Error 1

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

i'm using sabotage linux based on musl libc.

to help getting this resolved, can you try the following?

echo "CPPFLAGS += -D_XOPEN_SOURCE=700" > config.mak
make

and if that doesn't work either:

echo "CPPFLAGS += -D_GNU_SOURCE" > config.mak
make

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

added another commit which should fix it for real (studied glibc git features.h) ^

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

and yet another one!

from microsocks.

jimmy-ly00 avatar jimmy-ly00 commented on July 22, 2024

Hahaha, that seemed to have fixed it! thanks for fixing it so quickly

root@kali:~/microsocks# echo "CPPFLAGS += -D_XOPEN_SOURCE=700" > config.mak
root@kali:~/microsocks# make
cc -D_XOPEN_SOURCE=700 -Wall -std=c99   -c -o server.o server.c
cc -D_XOPEN_SOURCE=700 -Wall -std=c99   -c -o sblist.o sblist.c
sblist.c:8:2: warning: #warning "your C library sucks." [-Wcpp]
 #warning "your C library sucks."
  ^~~~~~~
cc -D_XOPEN_SOURCE=700 -Wall -std=c99   -c -o sblist_delete.o sblist_delete.c
cc  sockssrv.o server.o sblist.o sblist_delete.o -lpthread -o microsocks

from microsocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.