<p></p>
<h4>Description</h4>
<p>TCP client  cannot  send read only data</p>
<h4>Steps to reproduce the issue</h4>
<p>hardware:stm32f407ze<br>
usemodule:stm32_eth<br>
test ipv4 tcp client send const data like this "const char sendbuf[] = "Hello!";"<br>
The test code is as follows´╝Ü<br>
`<br>
const char sendbuf[] = "Hello!";<br>
int test_tcp_client(void)<br>
{<br>
int res = 0;<br>
sock_tcp_t sock;<br>
sock_tcp_ep_t remote = SOCK_IPV4_EP_ANY;</p>
<pre><code>remote.port = SERVER_PORT;//SERVER_PORT=12345

ipv4_addr_from_str((ipv4_addr_t *)&remote.addr, SERVER_IP_ADDR);//SERVER_IP_ADDR=192.168.12.89
xtimer_sleep(2);

if (sock_tcp_connect(&sock, &remote, 0, 0) < 0)
{
    puts("Error connecting sock");
    return 1;
}

puts("Sending \"Hello!\"");
if ((res = sock_tcp_write(&sock, sendbuf, sizeof(sendbuf))) < 0)
{
    puts("Errored on write");
}
puts("send over...");
</code></pre>
<p>`<br>
However, if the data sent is modified to  "char sendbuf[] = "Hello!";", without  "const",it will be sent successfully</p>
<h4>Expected results</h4>

<h4>Actual results</h4>

<h4>Versions</h4>
<h2>Operating System Environment</h2>
<pre><code>     Operating System: "Ubuntu" "18.04.5 LTS (Bionic Beaver)"
               Kernel: Linux 5.4.0-73-generic x86_64 x86_64
         System shell: /bin/dash (probably dash)
         make's shell: /bin/dash (probably dash)
</code></pre>
<h2>Installed compiler toolchains</h2>
<pre><code>           native gcc: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
    arm-none-eabi-gcc: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]
              avr-gcc: missing
     mips-mti-elf-gcc: missing
       msp430-elf-gcc: missing
   riscv-none-elf-gcc: missing
</code></pre>
<p>riscv64-unknown-elf-gcc: missing<br>
riscv-none-embed-gcc: missing<br>
xtensa-esp32-elf-gcc: missing<br>
xtensa-esp8266-elf-gcc: missing<br>
clang: missing</p>
<h2>Installed compiler libs</h2>
<pre><code> arm-none-eabi-newlib: "3.0.0"
  mips-mti-elf-newlib: missing
    msp430-elf-newlib: missing
riscv-none-elf-newlib: missing
</code></pre>
<p>riscv64-unknown-elf-newlib: missing<br>
riscv-none-embed-newlib: missing<br>
xtensa-esp32-elf-newlib: missing<br>
xtensa-esp8266-elf-newlib: missing<br>
avr-libc: missing (missing)</p>
<h2>Installed development tools</h2>
<pre><code>               ccache: missing
                cmake: cmake version 3.10.2
             cppcheck: missing
              doxygen: 1.8.13
                  git: git version 2.17.1
                 make: GNU Make 4.1
              openocd: missing
               python: Python 2.7.17
              python2: Python 2.7.17
              python3: Python 3.6.9
               flake8: error: /usr/bin/python3: No module named flake8
           coccinelle: missing
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/16541">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYE6UJOOGFAKK4ELR5LTR4CBDANCNFSM46LLC56A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYFY3PI35R4ZSUF4QL3TR4CBDA5CNFSM46LLC56KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NUWNQLA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/16541",
"url": "https://github.com/RIOT-OS/RIOT/issues/16541",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>