mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
PPP, PPPoS: Use const void*
instead of u8_t*
in pppos_input()
There is no good reason why this function should take a non-const pointer. While changing that also switch to a more generic `void*` instead of "byte".
This commit is contained in:
parent
c5021bdc4d
commit
5ad2f06333
@ -106,7 +106,7 @@ err_t pppos_input_tcpip(ppp_pcb *ppp, const void *s, int l);
|
||||
#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */
|
||||
|
||||
/* PPP over Serial: this is the input function to be called for received data. */
|
||||
void pppos_input(ppp_pcb *ppp, u8_t* data, int len);
|
||||
void pppos_input(ppp_pcb *ppp, const void* data, int len);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -477,10 +477,11 @@ PACK_STRUCT_END
|
||||
* @param l length of received data
|
||||
*/
|
||||
void
|
||||
pppos_input(ppp_pcb *ppp, u8_t *s, int l)
|
||||
pppos_input(ppp_pcb *ppp, const void *s, int l)
|
||||
{
|
||||
pppos_pcb *pppos = (pppos_pcb *)ppp->link_ctx_cb;
|
||||
struct pbuf *next_pbuf;
|
||||
const u8_t *s_u8 = (const u8_t *)s;
|
||||
u8_t cur_char;
|
||||
u8_t escaped;
|
||||
PPPOS_DECL_PROTECT(lev);
|
||||
@ -490,7 +491,7 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l)
|
||||
|
||||
PPPDEBUG(LOG_DEBUG, ("pppos_input[%d]: got %d bytes\n", ppp->netif->num, l));
|
||||
while (l-- > 0) {
|
||||
cur_char = *s++;
|
||||
cur_char = *s_u8++;
|
||||
|
||||
PPPOS_PROTECT(lev);
|
||||
/* ppp_input can disconnect the interface, we need to abort to prevent a memory
|
||||
|
Loading…
Reference in New Issue
Block a user