- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_subr_ncs.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 95 95 #include <net/ethernet.h> 96 96 #include <net/if_arp.h> 97 #include <net/ppp_ipcp.h>98 97 #include <net/net.h> 98 #include <net/net_endian.h> 99 99 #include <net/net_var.h> 100 100 #include <net/net_buf.h> … … 103 103 104 104 #include <netinet/in.h> 105 #include <netinet6/in6.h>106 #include <netinet6/in6_var.h>107 105 #include <netinet/in_var.h> 106 #include <netinet/in_itron.h> 108 107 #include <netinet/ip.h> 109 108 #include <netinet/ip_var.h> 110 #include <netinet/ip6.h>111 #include <netinet6/ip6_var.h>112 #include <netinet6/nd6.h>113 109 #include <netinet/tcp.h> 114 #include <netinet/tcp_timer.h>115 110 #include <netinet/tcp_var.h> 116 111 #include <netinet/tcp_fsm.h> 117 112 #include <netinet/tcp_seq.h> 118 #include <netinet/ in_itron.h>113 #include <netinet/tcp_timer.h> 119 114 120 115 #ifdef SUPPORT_TCP … … 134 129 { 135 130 uint8_t *wptr, *rptr; 131 uint_t sdu_size = GET_IP_SDU_SIZE(output); 132 uint_t hdr_offset = IF_IP_TCP_HDR_OFFSET(output); 136 133 137 134 /* SDU の大きさをチェックする。*/ 138 if ( GET_IP_SDU_SIZE(GET_IP_HDR(output)) < GET_TCP_HDR_SIZE2(output, IF_IP_TCP_HDR_OFFSET) + len) {135 if (sdu_size < GET_TCP_HDR_SIZE(output, hdr_offset) + len) { 139 136 syslog(LOG_INFO, "[TCP] shrink SUD len: %d -> %d", 140 (uint16_t)len, (uint16_t)( GET_IP_SDU_SIZE(GET_IP_HDR(output)) - GET_TCP_HDR_SIZE2(output, IF_IP_TCP_HDR_OFFSET)));141 len = GET_IP_SDU_SIZE(GET_IP_HDR(output)) - GET_TCP_HDR_SIZE2(output, IF_IP_TCP_HDR_OFFSET);142 } 143 144 wptr = GET_TCP_SDU(output, IF_IP_TCP_HDR_OFFSET);137 (uint16_t)len, (uint16_t)(sdu_size - GET_TCP_HDR_SIZE(output, hdr_offset))); 138 len = sdu_size - GET_TCP_HDR_SIZE(output, hdr_offset); 139 } 140 141 wptr = GET_TCP_SDU(output, hdr_offset); 145 142 146 143 /* 通信端点をロックする。*/ … … 222 219 223 220 if (IS_PTR_DEFINED(cep->callback)) 221 224 222 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 225 226 223 (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)(uint32_t)len); 227 228 #else /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 229 224 #else 230 225 (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)&len); 231 232 #endif /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 233 226 #endif 234 227 else 235 228 syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep)); … … 268 261 269 262 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 270 271 263 (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)error); 272 273 #else /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 274 264 #else 275 265 (*cep->callback)(GET_TCP_CEPID(cep), cep->snd_nblk_tfn, (void*)&error); 276 277 #endif /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 278 266 #endif 279 267 else 280 268 syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep)); … … 628 616 629 617 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 630 631 618 (*cep->callback)(GET_TCP_CEPID(cep), cep->rcv_nblk_tfn, (void*)(uint32_t)len); 632 633 #else /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 634 619 #else 635 620 (*cep->callback)(GET_TCP_CEPID(cep), cep->rcv_nblk_tfn, (void*)&len); 636 637 #endif /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 638 621 #endif 639 622 else 640 623 syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep)); … … 680 663 681 664 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 682 683 665 (*cep->callback)(GET_TCP_CEPID(cep), cep->rcv_nblk_tfn, (void*)(uint32_t)len); 684 685 #else /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 686 666 #else 687 667 (*cep->callback)(GET_TCP_CEPID(cep), cep->rcv_nblk_tfn, (void*)&len); 688 689 #endif /* of #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 */ 690 668 #endif 691 669 else 692 670 syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
Note:
See TracChangeset
for help on using the changeset viewer.