Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_subr_ncs.c

    r321 r331  
    22 *  TINET (TCP/IP Protocol Stack)
    33 *
    4  *  Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
     4 *  Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
    55 *                   Tomakomai National College of Technology, JAPAN
    66 *
     
    9595#include <net/ethernet.h>
    9696#include <net/if_arp.h>
    97 #include <net/ppp_ipcp.h>
    9897#include <net/net.h>
     98#include <net/net_endian.h>
    9999#include <net/net_var.h>
    100100#include <net/net_buf.h>
     
    103103
    104104#include <netinet/in.h>
    105 #include <netinet6/in6.h>
    106 #include <netinet6/in6_var.h>
    107105#include <netinet/in_var.h>
     106#include <netinet/in_itron.h>
    108107#include <netinet/ip.h>
    109108#include <netinet/ip_var.h>
    110 #include <netinet/ip6.h>
    111 #include <netinet6/ip6_var.h>
    112 #include <netinet6/nd6.h>
    113109#include <netinet/tcp.h>
    114 #include <netinet/tcp_timer.h>
    115110#include <netinet/tcp_var.h>
    116111#include <netinet/tcp_fsm.h>
    117112#include <netinet/tcp_seq.h>
    118 #include <netinet/in_itron.h>
     113#include <netinet/tcp_timer.h>
    119114
    120115#ifdef SUPPORT_TCP
     
    134129{
    135130        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);
    136133
    137134        /* 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) {
    139136                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);
    145142
    146143        /* 通信端点をロックする。*/
     
    222219
    223220                        if (IS_PTR_DEFINED(cep->callback))
     221
    224222#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    225 
    226223                                (*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
    230225                                (*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
    234227                        else
    235228                                syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
     
    268261
    269262#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    270 
    271263                        (*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
    275265                        (*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
    279267                else
    280268                        syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
     
    628616
    629617#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    630 
    631618                                (*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
    635620                                (*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
    639622                        else
    640623                                syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
     
    680663
    681664#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    682 
    683665                                (*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
    687667                                (*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
    691669                        else
    692670                                syslog(LOG_WARNING, "[TCP] no call back, CEP: %d.", GET_TCP_CEPID(cep));
Note: See TracChangeset for help on using the changeset viewer.