Skip to content
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

linux compile issues #32

Open
pthornton opened this issue Dec 3, 2014 · 13 comments
Open

linux compile issues #32

pthornton opened this issue Dec 3, 2014 · 13 comments

Comments

@pthornton
Copy link

Looks like the Linux port is out of sync. It's referencing a BSD file vnet.h which is included under sys/net/vnet.h, but that folder is not included in the Makefile. If I modify the Makefile, there are too many errors to list here. I've tried this on Centos 6(preferred) and Ubuntu 12.04.
-randy

@caladri
Copy link
Collaborator

caladri commented Dec 3, 2014

Please include the command you ran, the directory within libuinet you ran it in, and the output you got.

@pthornton
Copy link
Author

git clone https://code.google.com/p/netmap/
git clone https://github.com/pkelsey/libuinet.git
cd libuinet/lib/libuinet/
make NETMAP_INCLUDES=/home/pthornton/netmap/sys/

@pthornton
Copy link
Author

pthornton@pthornton-virtual-machine:~/libuinet/lib/libuinet$ make
cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -O -gdwarf-2 -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-inline -Wcast-qual -Wno-pointer-sign -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unused-but-set-variable -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DUINET=1 -fstack-protector -I. -I/home/pthornton/libuinet/lib/libuinet/api_include -I../libuinetnv -Werror uinet_host_sysctl_api.c
In file included from uinet_host_sysctl_api.c:44:0:
uinet_internal.h:33:22: fatal error: net/vnet.h: No such file or directory
compilation terminated.
make: *** [uinet_host_sysctl_api.o] Error 1

@weliu
Copy link

weliu commented Dec 23, 2014

I resolved this issue by adding forward declaration of vnet and removing the vnet.h header file

@ratliffstan
Copy link

weliu, can you be more specific as to what forward delcaration you added? I've hit the same issue, and I'm looking at vnet.h on github - it's almost 400 lines of code...

@caladri
Copy link
Collaborator

caladri commented Jan 28, 2015

@ratliffstan, what @weliu is saying is that removing the net/vnet.h include from uinet_internal.h and then adding, I believe, a forward declaration in its place of struct vnet; or similar. It should be fairly obvious what is missing if you remove the include, by seeing what the next compile error is. It's not clear to me why this error would occur in the first place, however. But it should be straightforward to work around if @weliu is correct.

@ratliffstan
Copy link

@caladri Thanks! I have one other naive question. Let's assume I have started the WANproxy with libuinet, and have assigned 'eth1' to the proxy. But ingress traffic to that port includes some "non-proxy" traffic (e.g. VoIP packets, multicast traffic, and the like). From my tentative testing, it appears that this traffic gets dropped. Is there a way to configure the proxy/libuinet such that this traffic continues to flow to the correct destination?

@ratliffstan
Copy link

My apologies for spamming this board, but I have one more question. Does libuinet support route or raw sockets?

@weliu
Copy link

weliu commented Feb 4, 2015

@caladri, this issue occured because the vnet.h file does not exist in Linux /usr/include, but FreeBSD does, because VIMAGE is a FreeBSD feature.

@ratliffstan, I have used uinet_socreate() uinet_sosend() API to add or remove route in libuinet instance. If your are under Linux, you also need to copy FreeBSD's route.h file to Linux /usr/include, because LINUX don't have struct rt_msghdr or other route related structs definition.

@caladri
Copy link
Collaborator

caladri commented Feb 4, 2015

@weliu, some of that sounds suspicious to me. It seems likely that the files in question should be using the libuinet copies of headers, not the ones in /usr/include. Right, @pkelsey?

@ratliffstan
Copy link

@weliu - Interesting, thanks.

@caladri @pkelsey - I'm still concerned about running the proxy and getting other traffic dropped. I have WANproxy running on eth1 (via Netmap), and have multiple addresses for my Linux host. Trying to "ping" from a secondary host, via eth1, and the traffic is dropped when the proxy is running. Is there a way to configure such that other traffic (like ICMP) gets passed through as it should?

@caladri
Copy link
Collaborator

caladri commented Feb 4, 2015

@ratliffstan, that is a reasonable concern, but honestly I'm not sure libuinet is the place to fix it. Honestly, in that sort of situation what you want is to use VALE to have a virtual network set up on which the proxy is connected to two different VALE switches, and you have a packet processor with a configurable policy determining which packets to pass to the proxy and which get bridged or sent to the host network stack. I've started on something that would be useful for this, but am not aware of any complete open source options. Maybe Intel's openvswitch stuff? I could provide you with a sample configuration that would do this with a tool I've written, but it has some rough edges.

@ratliffstan
Copy link

@caladri Thank you for the information. I'll go check openvswitch. And yes, I'd be happy to take a look at your sample config and tool. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants