ndt-project / ndt

Network Diagnostic Tool
Other
178 stars 45 forks source link

Code does not compile when using web10g #183

Closed skostuch closed 9 years ago

skostuch commented 9 years ago

After merging changes from websocket branch, code does not compile when using web10g (it works only for web100). It seems like blocks of code unique for web10g does still use old variable names and also generate some warnings that due to -Werror flag being set result in compilation error too.

aaronmbr commented 9 years ago

I fixed some web10g compilation issues in master, are these the ones that you were hitting?

skostuch commented 9 years ago

Among the others yes. I've committed changes that also fix compilation warnings which I was getting and which due to -Werror flag resulted in compilation error. Now code should compile fine both on web10g and web100 (tested on both). If changes look good for you then feel free to close this issue.

aaronmbr commented 9 years ago

Apparently, 4.6 uses a "-Wunused-but-set-variable" by default which will cause all the code of the form:

int ret = pipe(mon_pipe);

to spit out an error as well. It might make more sense to convert the 'system' ones to:

if (system("echo 1 > /proc/sys/net/ipv4/route/flush") != 0) { // spit out a warning }

The pipes all seem to be packet trace things, so you could probably do a similar:

if (pipe(mon_pipe) != 0) { // spit out a warning } else { // the rest of the packet trace code }

If nothing else, I think if the pipe doesn't work, the rest of the code may unhelpfully segfault. You may want to do a similar error check for the fork() itself.

skostuch commented 9 years ago

I've committed changes with proper fixes

aaronmbr commented 9 years ago

Seems good. Closing.