git://git.onelab.eu
/
vsys-scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1436ad1
)
Bug fix: Receive control channel from vsys
author
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 17 Sep 2010 16:14:08 +0000
(12:14 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 17 Sep 2010 16:14:08 +0000
(12:14 -0400)
fd_packetseer.c
patch
|
blob
|
history
fdpass.c
patch
|
blob
|
history
diff --git
a/fd_packetseer.c
b/fd_packetseer.c
index
f4b2899
..
6c9089b
100644
(file)
--- a/
fd_packetseer.c
+++ b/
fd_packetseer.c
@@
-34,11
+34,13
@@
main(int argc, char *argv[])
exit(1);
}
exit(1);
}
+ sscanf(argv[2],"%d", &control_channel_fd);
magic_socket = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (magic_socket == -1) {
fprintf(stderr, "Error creating socket: %d\n", errno);
exit(1);
}
magic_socket = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (magic_socket == -1) {
fprintf(stderr, "Error creating socket: %d\n", errno);
exit(1);
}
+ else fprintf(stderr, "Socket: %d", magic_socket);
send_fd(control_channel_fd, magic_socket);
}
send_fd(control_channel_fd, magic_socket);
}
diff --git
a/fdpass.c
b/fdpass.c
index
5548064
..
6bf4692
100644
(file)
--- a/
fdpass.c
+++ b/
fdpass.c
@@
-41,6
+41,7
@@
int send_fd(int sock_fd, int fd)
while ((retval = sendmsg(sock_fd, &msg, 0)) == -1 && errno == EINTR);
if (retval != 1) {
perror("sending file descriptor");
while ((retval = sendmsg(sock_fd, &msg, 0)) == -1 && errno == EINTR);
if (retval != 1) {
perror("sending file descriptor");
+ fprintf(stderr,"File descriptor: %d", sock_fd);
return -1;
}
return 0;
return -1;
}
return 0;