diff options
author | Sergey Matveychuk <sem@FreeBSD.org> | 2005-03-11 13:51:32 +0000 |
---|---|---|
committer | Sergey Matveychuk <sem@FreeBSD.org> | 2005-03-11 13:51:32 +0000 |
commit | 032fc7a937a99728fd73f642950e45fb59ea55e5 (patch) | |
tree | f9cff82a48e3421e2b160246e1931048dfaf8a87 /net/vde/files/patch-port.c | |
parent | Unbreak: USE_KDEBASE instead of KDELIBS since libkate* is over there (diff) |
VDE is a user-mode ethernet simulation. It's quite useful for
hooking together multiple qemu instances into a single virtual
network without needing root access. It can also be used for
tunneling or other network simulation tasks.
PR: ports/76874
Submitted by: Craig Boston <craig@yekse.gank.org>
Notes
Notes:
svn path=/head/; revision=130884
Diffstat (limited to 'net/vde/files/patch-port.c')
-rw-r--r-- | net/vde/files/patch-port.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/vde/files/patch-port.c b/net/vde/files/patch-port.c new file mode 100644 index 000000000000..02d2359c0e15 --- /dev/null +++ b/net/vde/files/patch-port.c @@ -0,0 +1,34 @@ +--- port.c Sat Jan 29 15:02:08 2005 ++++ port.c Sun Jan 30 11:36:03 2005 +@@ -10,6 +10,9 @@ + #include <syslog.h> + #include <sys/socket.h> + #include <sys/un.h> ++#ifdef __FreeBSD__ ++#include <string.h> ++#endif + #include "switch.h" + #include "hash.h" + #include "port.h" +@@ -316,10 +319,19 @@ + port=p->data; + //if(match_sock(p->control, fd, p->data, p->data_len, &data)) break; + if(p->data_len == sizeof(struct sock_data) && +- !(memcmp(&(port->sock), &mine->sock, sizeof(mine->sock)))) break; ++#ifdef __FreeBSD__ ++ port->sock.sun_family == mine->sock.sun_family && ++ !(strcmp(port->sock.sun_path, mine->sock.sun_path))) ++#else ++ !(memcmp(&(port->sock), &mine->sock, sizeof(mine->sock)))) ++#endif ++ break; + } + } +- handle_direct_data(p,hub,&packet,len); ++ if (i < g_nfds) ++ handle_direct_data(p,hub,&packet,len); ++ else ++ printlog(LOG_WARNING, "No port associated with descriptor %d", fd); + return 0; + } + |