diff --git a/UPGRADING b/UPGRADING index 00824128..eb14dc53 100644 --- a/UPGRADING +++ b/UPGRADING @@ -9,6 +9,7 @@ with newer versions. * [Enter new changes just after this line - do not remove this line] * The eth_addr_cmp and ip_addr_cmp set of functions have been renamed to eth_addr_eq, ip_addr_eq and so on, since they return non-zero on equality. Macros for the old names exist. + * The sio_write function used by PPP now takes the data argument as const. (2.1.0) diff --git a/contrib/examples/example_app/test.c b/contrib/examples/example_app/test.c index 21b682cb..fc168443 100644 --- a/contrib/examples/example_app/test.c +++ b/contrib/examples/example_app/test.c @@ -262,7 +262,7 @@ ppp_output_cb(ppp_pcb *pcb, const void *data, u32_t len, void *ctx) { LWIP_UNUSED_ARG(pcb); LWIP_UNUSED_ARG(ctx); - return sio_write(ppp_sio, (u8_t*)data, len); + return sio_write(ppp_sio, (const u8_t*)data, len); } #endif /* PPPOS_SUPPORT */ #endif /* USE_PPP */ diff --git a/contrib/examples/ppp/pppos_example.c b/contrib/examples/ppp/pppos_example.c index d356eecc..0d18ce52 100644 --- a/contrib/examples/ppp/pppos_example.c +++ b/contrib/examples/ppp/pppos_example.c @@ -160,7 +160,7 @@ ppp_output_cb(ppp_pcb *pcb, const void *data, u32_t len, void *ctx) { LWIP_UNUSED_ARG(pcb); LWIP_UNUSED_ARG(ctx); - return sio_write(ppp_sio, (u8_t*)data, len); + return sio_write(ppp_sio, (const u8_t*)data, len); } #if LWIP_NETIF_STATUS_CALLBACK diff --git a/contrib/ports/unix/port/netif/sio.c b/contrib/ports/unix/port/netif/sio.c index b33e6752..8d8be9be 100644 --- a/contrib/ports/unix/port/netif/sio.c +++ b/contrib/ports/unix/port/netif/sio.c @@ -300,7 +300,7 @@ void sio_expect_string( u8_t *str, sio_status_t * siostat ) #endif /* ! (PPP_SUPPORT || LWIP_HAVE_SLIPIF) */ #if (PPP_SUPPORT || LWIP_HAVE_SLIPIF) -u32_t sio_write(sio_status_t * siostat, u8_t *buf, u32_t size) +u32_t sio_write(sio_status_t * siostat, const u8_t *buf, u32_t size) { ssize_t wsz = write( siostat->fd, buf, size ); return wsz < 0 ? 0 : wsz; diff --git a/contrib/ports/win32/sio.c b/contrib/ports/win32/sio.c index 1cf1ef5e..0b64492b 100644 --- a/contrib/ports/win32/sio.c +++ b/contrib/ports/win32/sio.c @@ -278,7 +278,7 @@ u32_t sio_tryread(sio_fd_t fd, u8_t* data, u32_t len) * * @note This function will block until all data can be sent. */ -u32_t sio_write(sio_fd_t fd, u8_t* data, u32_t len) +u32_t sio_write(sio_fd_t fd, const u8_t* data, u32_t len) { BOOL ret; DWORD dwNbBytesWritten = 0; diff --git a/src/include/lwip/sio.h b/src/include/lwip/sio.h index 7643e195..12d2a7e9 100644 --- a/src/include/lwip/sio.h +++ b/src/include/lwip/sio.h @@ -123,7 +123,7 @@ u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len); * * @note This function will block until all data can be sent. */ -u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); +u32_t sio_write(sio_fd_t fd, const u8_t *data, u32_t len); #endif #ifndef sio_read_abort