projects
/
swifty.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
378ae9c
)
Mark socket as bound in list_update_socket_address.
author
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Sat, 4 Jun 2011 09:28:25 +0000
(12:28 +0300)
committer
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Sat, 4 Jun 2011 09:48:31 +0000
(12:48 +0300)
src/raw/swift_list.c
patch
|
blob
|
history
diff --git
a/src/raw/swift_list.c
b/src/raw/swift_list.c
index
31dbeb1
..
786c6fc
100644
(file)
--- a/
src/raw/swift_list.c
+++ b/
src/raw/swift_list.c
@@
-24,6
+24,7
@@
#include "include/swift_types.h"
#include "include/swift_list.h"
#include "include/swift_types.h"
#include "include/swift_list.h"
+#include "debug.h"
/*
* Add new socket to list. Called by sw_socket "syscall".
/*
* Add new socket to list. Called by sw_socket "syscall".
@@
-55,6
+56,7
@@
struct sock_list *list_update_socket_address(int s, __CONST_SOCKADDR_ARG addr)
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next)
if (ptr->s == s) {
memcpy(&ptr->addr, addr, sizeof(ptr->addr));
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next)
if (ptr->s == s) {
memcpy(&ptr->addr, addr, sizeof(ptr->addr));
+ ptr->bind_state = STATE_BOUND;
return ptr;
}
return ptr;
}
@@
-70,7
+72,7
@@
struct sock_list *list_elem_from_socket(int s)
struct sock_list *ptr;
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next)
struct sock_list *ptr;
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next)
- if (ptr->s == s)
+ if (ptr->s == s)
return ptr;
return NULL;
return ptr;
return NULL;
@@
-85,8
+87,10
@@
struct sock_list *list_elem_from_address(__CONST_SOCKADDR_ARG addr)
struct sock_list *ptr;
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next) {
struct sock_list *ptr;
for (ptr = sock_list_head.next; ptr != &sock_list_head; ptr = ptr->next) {
+ dprintf("socket address to be checked\n");
if (ptr->bind_state == STATE_NOTBOUND)
continue;
if (ptr->bind_state == STATE_NOTBOUND)
continue;
+ dprintf("bound socket address to be checked\n");
if (memcmp(&ptr->addr, addr, sizeof(addr)) == 0)
return ptr;
}
if (memcmp(&ptr->addr, addr, sizeof(addr)) == 0)
return ptr;
}