BIND 10 trac366, updated. 20f12e8672c45540cd72bb5df44cf21ff3b6732f [trac366] Small fixups
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Apr 6 20:07:23 UTC 2011
The branch, trac366 has been updated
via 20f12e8672c45540cd72bb5df44cf21ff3b6732f (commit)
from 13668e95ca6bbb07128babb14f1772bfefcb09a8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 20f12e8672c45540cd72bb5df44cf21ff3b6732f
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Apr 6 22:07:09 2011 +0200
[trac366] Small fixups
-----------------------------------------------------------------------
Summary of changes:
src/bin/sockcreator/README | 8 ++++----
src/bin/sockcreator/sockcreator.cc | 16 +++++++---------
2 files changed, 11 insertions(+), 13 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/sockcreator/README b/src/bin/sockcreator/README
index d3abc9e..84a0f6d 100644
--- a/src/bin/sockcreator/README
+++ b/src/bin/sockcreator/README
@@ -33,10 +33,10 @@ must be a socket, not pipe.
like hton called on them).
The answer to this is either 'S' and then the socket is passed using sendmsg
- if it is successful. If it fails, 'E' is returned, followed by either
- 'S' or 'B' (either socket() or bind() call failed). Then there is one int
- (architecture-dependent length and endianess), which is the errno value
- after the failure.
+ if it is successful (it uses our send_fd, you can use recv_fd to read it).
+ If it fails, 'E' is returned, followed by either 'S' or 'B' (either socket()
+ or bind() call failed). Then there is one int (architecture-dependent length
+ and endianess), which is the errno value after the failure.
The creator may also send these messages at any time (but not in the middle
of another message):
diff --git a/src/bin/sockcreator/sockcreator.cc b/src/bin/sockcreator/sockcreator.cc
index 76f6e94..b9da84f 100644
--- a/src/bin/sockcreator/sockcreator.cc
+++ b/src/bin/sockcreator/sockcreator.cc
@@ -41,15 +41,6 @@ get_sock(const int type, struct sockaddr *bind_addr, const socklen_t addr_len)
return sock;
}
-int
-send_fd(const int, const int) {
- return 0;
-}
-
-int
-run(const int input_fd, const int output_fd, const get_sock_t get_sock,
- const send_fd_t send_fd)
-{
// These are macros so they can exit the function
#define READ(WHERE, HOW_MANY) do { \
size_t how_many = (HOW_MANY); \
@@ -57,15 +48,22 @@ run(const int input_fd, const int output_fd, const get_sock_t get_sock,
return 1; \
} \
} while (0)
+
#define WRITE(WHAT, HOW_MANY) do { \
if (!write_data(output_fd, (WHAT), (HOW_MANY))) { \
return 2; \
} \
} while (0)
+
#define DEFAULT \
default: /* Unrecognized part of protocol */ \
WRITE("FI", 2); \
return 3;
+
+int
+run(const int input_fd, const int output_fd, const get_sock_t get_sock,
+ const send_fd_t send_fd)
+{
for (;;) {
// Read the command
char command;
More information about the bind10-changes
mailing list