projects
/
swifty.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add bound check/ debug message destination address
[swifty.git]
/
src
/
raw
/
swift_raw.c
diff --git
a/src/raw/swift_raw.c
b/src/raw/swift_raw.c
index
937c62d
..
4f26551
100644
(file)
--- a/
src/raw/swift_raw.c
+++ b/
src/raw/swift_raw.c
@@
-22,9
+22,9
@@
#include <unistd.h>
#include <errno.h>
#include <unistd.h>
#include <errno.h>
-#include "swift_types.h"
-#include "swift_raw.h"
-#include "swift_list.h"
+#include "
include/
swift_types.h"
+#include "
include/
swift_raw.h"
+#include "
include/
swift_list.h"
/*
* Create a new socket of type TYPE in domain DOMAIN, using
/*
* Create a new socket of type TYPE in domain DOMAIN, using
@@
-140,22
+140,24
@@
ssize_t sw_sendto(int __fd, __const void *__buf, size_t __n,
struct sock_list *list;
struct iovec __iov[1];
struct msghdr __msgh;
struct sock_list *list;
struct iovec __iov[1];
struct msghdr __msgh;
-
+ struct sockaddr_sw *__sw_addr = (struct sockaddr_sw *) __addr;
+
+ printf("=== ADDR: %s ===", ntohl(__sw_addr->sin_addr.s_addr));
list = list_elem_from_socket(__fd);
if (list == NULL) {
errno = EBADF;
goto sock_err;
}
list = list_elem_from_socket(__fd);
if (list == NULL) {
errno = EBADF;
goto sock_err;
}
-/*
- if (list->
state == STATE_NO
BOUND) {
+
+ if (list->
bind_state == STATE_NOT
BOUND) {
errno = EDESTADDRREQ;
goto sock_err;
}
errno = EDESTADDRREQ;
goto sock_err;
}
- */
+
/* Specify the components of the message in an "iovec". */
/* Specify the components of the message in an "iovec". */
- __iov[0].iov_base = __buf;
+ __iov[0].iov_base =
(void *)
__buf;
__iov[0].iov_len = __n;
/* The message header contains parameters for sendmsg. */
__iov[0].iov_len = __n;
/* The message header contains parameters for sendmsg. */