Changes in uspace/srv/net/tl/tcp/tcp.c [b5eae30:fe5e9629] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp.c
rb5eae30 rfe5e9629 36 36 37 37 #include <async.h> 38 #include <bitops.h> 38 39 #include <byteorder.h> 39 40 #include <errno.h> … … 191 192 tcp_pdu_t *pdu; 192 193 size_t hdr_size; 193 194 /* XXX Header options */ 195 hdr_size = sizeof(tcp_header_t); 194 tcp_header_t *hdr; 195 uint32_t data_offset; 196 197 if (pdu_raw_size < sizeof(tcp_header_t)) { 198 log_msg(LVL_WARN, "pdu_raw_size = %zu < sizeof(tcp_header_t) = %zu", 199 pdu_raw_size, sizeof(tcp_header_t)); 200 pq_release_remote(net_sess, packet_get_id(packet)); 201 return EINVAL; 202 } 203 204 hdr = (tcp_header_t *)pdu_raw; 205 data_offset = BIT_RANGE_EXTRACT(uint32_t, DF_DATA_OFFSET_h, DF_DATA_OFFSET_l, 206 uint16_t_be2host(hdr->doff_flags)); 207 208 hdr_size = sizeof(uint32_t) * data_offset; 196 209 197 210 if (pdu_raw_size < hdr_size) { 198 211 log_msg(LVL_WARN, "pdu_raw_size = %zu < hdr_size = %zu", 199 212 pdu_raw_size, hdr_size); 213 pq_release_remote(net_sess, packet_get_id(packet)); 214 return EINVAL; 215 } 216 217 if (hdr_size < sizeof(tcp_header_t)) { 218 log_msg(LVL_WARN, "hdr_size = %zu < sizeof(tcp_header_t) = %zu", 219 hdr_size, sizeof(tcp_header_t)); 200 220 pq_release_remote(net_sess, packet_get_id(packet)); 201 221 return EINVAL;
Note:
See TracChangeset
for help on using the changeset viewer.