Changeset 3aa2642a in mainline
- Timestamp:
- 2011-12-04T12:46:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf600510
- Parents:
- 704586fb
- Location:
- uspace/srv/net/tl/tcp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/conn.c
r704586fb r3aa2642a 212 212 * is equal. 213 213 */ 214 static bool tcp_socket_equal(tcp_sock_t *a, tcp_sock_t *b) 215 { 216 log_msg(LVL_DEBUG, "tcp_socket_equal((%x,%u), (%x,%u))", 217 a->addr.ipv4, a->port, b->addr.ipv4, b->port); 218 219 if (a->addr.ipv4 != b->addr.ipv4) 214 static bool tcp_socket_match(tcp_sock_t *sock, tcp_sock_t *patt) 215 { 216 log_msg(LVL_DEBUG, "tcp_socket_match(sock=(%x,%u), pat=(%x,%u))", 217 sock->addr.ipv4, sock->port, patt->addr.ipv4, patt->port); 218 219 if (patt->addr.ipv4 != TCP_IPV4_ANY && 220 patt->addr.ipv4 != sock->addr.ipv4) 220 221 return false; 221 222 222 if (a->port != b->port) 223 if (patt->port != TCP_PORT_ANY && 224 patt->port != sock->port) 223 225 return false; 224 226 … … 233 235 log_msg(LVL_DEBUG, "tcp_sockpair_match(%p, %p)", sp, pattern); 234 236 235 if (!tcp_socket_ equal(&sp->local, &pattern->local))237 if (!tcp_socket_match(&sp->local, &pattern->local)) 236 238 return false; 237 239 238 if (!tcp_socket_ equal(&sp->foreign, &pattern->foreign))240 if (!tcp_socket_match(&sp->foreign, &pattern->foreign)) 239 241 return false; 240 242 -
uspace/srv/net/tl/tcp/sock.c
r704586fb r3aa2642a 305 305 log_msg(LVL_DEBUG, " - open connection"); 306 306 307 fsocket.addr.ipv4 = 0x7f000001; /* XXX */308 fsocket.port = 1025; /* XXX */307 fsocket.addr.ipv4 = TCP_IPV4_ANY; 308 fsocket.port = TCP_PORT_ANY; 309 309 310 310 trc = tcp_uc_open(sock_core->port, &fsocket, ap_passive, &conn); -
uspace/srv/net/tl/tcp/tcp_type.h
r704586fb r3aa2642a 119 119 } tcp_sock_t; 120 120 121 enum netaddr { 122 TCP_IPV4_ANY = 0 123 }; 124 125 enum tcp_port { 126 TCP_PORT_ANY = 0 127 }; 128 121 129 typedef struct { 122 130 tcp_sock_t local; -
uspace/srv/net/tl/tcp/ucall.c
r704586fb r3aa2642a 242 242 conn = tcp_conn_find(sp); 243 243 if (conn != NULL && conn->cstate != st_closed) { 244 if (conn->ident.foreign.addr.ipv4 == TCP_IPV4_ANY) 245 conn->ident.foreign.addr.ipv4 = sp->foreign.addr.ipv4; 246 if (conn->ident.foreign.port == TCP_PORT_ANY) 247 conn->ident.foreign.port = sp->foreign.port; 248 244 249 tcp_conn_segment_arrived(conn, seg); 245 250 } else {
Note:
See TracChangeset
for help on using the changeset viewer.