mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-12 03:37:23 +00:00
PPP, PPPoS: Fix update SNMP ifoutoctets counter in pppos_output_last()
Current code does not correctly update ifoutoctets counter because nb->tot_len is always 0. Fix it by setting nb->tot_len to actual payload length so we can update ifoutoctets correctly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Sylvain Rochet <gradator@gradator.net>
This commit is contained in:
parent
5bddbdd914
commit
79f2200b27
@ -217,6 +217,9 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p)
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
/* Set nb->tot_len to actual payload length */
|
||||
nb->tot_len = p->len;
|
||||
|
||||
/* If the link has been idle, we'll send a fresh flag character to
|
||||
* flush any noise. */
|
||||
err = ERR_OK;
|
||||
@ -262,6 +265,9 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol)
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
/* Set nb->tot_len to actual payload length */
|
||||
nb->tot_len = pb->tot_len;
|
||||
|
||||
/* If the link has been idle, we'll send a fresh flag character to
|
||||
* flush any noise. */
|
||||
err = ERR_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user