Changeset 3bacee1 in mainline for uspace/srv/net
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- uspace/srv/net
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dnsrsrv/dns_msg.c
r76d0981d r3bacee1 383 383 question->qtype = dns_uint16_t_decode(pdu->data + name_eoff, 384 384 pdu->size - name_eoff); 385 question->qclass = dns_uint16_t_decode(pdu->data + sizeof(uint16_t) 386 +name_eoff, pdu->size - sizeof(uint16_t) - name_eoff);385 question->qclass = dns_uint16_t_decode(pdu->data + sizeof(uint16_t) + 386 name_eoff, pdu->size - sizeof(uint16_t) - name_eoff); 387 387 *eoff = name_eoff + 2 * sizeof(uint16_t); 388 388 … … 449 449 450 450 log_msg(LOG_DEFAULT, LVL_DEBUG2, "dns_rr_decode: rtype=0x%x, rclass=0x%x, ttl=0x%x", 451 rr->rtype, rr->rclass, rr->ttl 451 rr->rtype, rr->rclass, rr->ttl); 452 452 453 453 rdlength = dns_uint16_t_decode(bp, bsz); … … 510 510 (msg->rd ? BIT_V(uint16_t, OPB_RD) : 0) | 511 511 (msg->ra ? BIT_V(uint16_t, OPB_RA) : 0) | 512 msg->rcode 513 ); 512 msg->rcode); 514 513 515 514 hdr.qd_count = host2uint16_t_be(list_count(&msg->question)); -
uspace/srv/net/ethip/pdu.c
r76d0981d r3bacee1 124 124 125 125 switch (packet->opcode) { 126 case aop_request: fopcode = AOP_REQUEST; break; 127 case aop_reply: fopcode = AOP_REPLY; break; 126 case aop_request: 127 fopcode = AOP_REQUEST; 128 break; 129 case aop_reply: 130 fopcode = AOP_REPLY; 131 break; 128 132 default: 129 133 assert(false); … … 187 191 188 192 switch (uint16_t_be2host(pfmt->opcode)) { 189 case AOP_REQUEST: packet->opcode = aop_request; break; 190 case AOP_REPLY: packet->opcode = aop_reply; break; 193 case AOP_REQUEST: 194 packet->opcode = aop_request; 195 break; 196 case AOP_REPLY: 197 packet->opcode = aop_reply; 198 break; 191 199 default: 192 200 log_msg(LOG_DEFAULT, LVL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")", -
uspace/srv/net/inetsrv/pdu.c
r76d0981d r3bacee1 72 72 73 73 for (i = 0; i < words; i++) { 74 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];74 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 75 75 sum = inet_ocadd16(sum, w); 76 76 } 77 77 78 78 if (size % 2 != 0) { 79 w = ((uint16_t)bdata[2 *words] << 8);79 w = ((uint16_t)bdata[2 * words] << 8); 80 80 sum = inet_ocadd16(sum, w); 81 81 } -
uspace/srv/net/slip/slip.c
r76d0981d r3bacee1 284 284 */ 285 285 286 pass:286 pass: 287 287 rc = iplink_ev_recv(&slip_iplink, &sdu, ip_v4); 288 288 if (rc != EOK) { … … 374 374 if (rc != EOK) { 375 375 log_msg(LOG_DEFAULT, LVL_ERROR, 376 "Failed to register service %s",377 linkstr);376 "Failed to register service %s", 377 linkstr); 378 378 goto fail; 379 379 } -
uspace/srv/net/tcp/conn.c
r76d0981d r3bacee1 156 156 157 157 /* Initialize retransmission queue */ 158 if (tcp_tqueue_init(&conn->retransmit, conn, &tcp_conn_tqueue_cb) 159 !=EOK) {158 if (tcp_tqueue_init(&conn->retransmit, conn, &tcp_conn_tqueue_cb) != 159 EOK) { 160 160 goto error; 161 161 } -
uspace/srv/net/tcp/inet.c
r76d0981d r3bacee1 97 97 if (hdr_size < sizeof(tcp_header_t)) { 98 98 log_msg(LOG_DEFAULT, LVL_WARN, "hdr_size = %zu < sizeof(tcp_header_t) = %zu", 99 hdr_size, sizeof(tcp_header_t)); return EINVAL; 99 hdr_size, sizeof(tcp_header_t)); 100 return EINVAL; 100 101 } 101 102 -
uspace/srv/net/tcp/pdu.c
r76d0981d r3bacee1 73 73 74 74 for (i = 0; i < words; i++) { 75 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];75 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 76 76 sum = tcp_ocadd16(sum, w); 77 77 } 78 78 79 79 if (size % 2 != 0) { 80 w = ((uint16_t)bdata[2 *words] << 8);80 w = ((uint16_t)bdata[2 * words] << 8); 81 81 sum = tcp_ocadd16(sum, w); 82 82 } -
uspace/srv/net/tcp/seq_no.c
r76d0981d r3bacee1 170 170 171 171 /* Beginning of segment is inside window */ 172 b_in = seq_no_le_lt(conn->rcv_nxt, seg->seq, conn->rcv_nxt 173 +conn->rcv_wnd);172 b_in = seq_no_le_lt(conn->rcv_nxt, seg->seq, conn->rcv_nxt + 173 conn->rcv_wnd); 174 174 175 175 /* End of segment is inside window */ -
uspace/srv/net/tcp/test/conn.c
r76d0981d r3bacee1 139 139 140 140 while (conn->cstate == st_syn_sent) 141 141 fibril_condvar_wait(&conn->cstate_cv, &conn->lock); 142 142 143 143 PCUT_ASSERT_INT_EQUALS(st_closed, conn->cstate); … … 194 194 /* Wait for client-side state to transition */ 195 195 while (cconn->cstate == st_syn_sent) 196 196 fibril_condvar_wait(&cconn->cstate_cv, &cconn->lock); 197 197 198 198 PCUT_ASSERT_INT_EQUALS(st_established, cconn->cstate); … … 203 203 tcp_conn_lock(sconn); 204 204 while (sconn->cstate == st_listen || sconn->cstate == st_syn_received) 205 205 fibril_condvar_wait(&sconn->cstate_cv, &sconn->lock); 206 206 207 207 PCUT_ASSERT_INT_EQUALS(st_established, sconn->cstate); -
uspace/srv/net/tcp/test/rqueue.c
r76d0981d r3bacee1 107 107 seg_cnt = 0; 108 108 109 109 inet_ep2_init(&epp); 110 110 111 111 tcp_rqueue_fibril_start(); -
uspace/srv/net/tcp/test/seq_no.c
r76d0981d r3bacee1 130 130 conn->rcv_wnd = (uint32_t) -10; 131 131 132 PCUT_ASSERT_FALSE(seq_no_in_rcv_wnd(conn, 19));132 PCUT_ASSERT_FALSE(seq_no_in_rcv_wnd(conn, 19)); 133 133 PCUT_ASSERT_TRUE(seq_no_in_rcv_wnd(conn, 20)); 134 134 PCUT_ASSERT_TRUE(seq_no_in_rcv_wnd(conn, 21)); -
uspace/srv/net/udp/pdu.c
r76d0981d r3bacee1 72 72 73 73 for (i = 0; i < words; i++) { 74 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];74 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 75 75 sum = udp_ocadd16(sum, w); 76 76 } 77 77 78 78 if (size % 2 != 0) { 79 w = ((uint16_t)bdata[2 *words] << 8);79 w = ((uint16_t)bdata[2 * words] << 8); 80 80 sum = udp_ocadd16(sum, w); 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.