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:
Axel Lin 2017-06-22 20:12:54 +08:00 committed by Sylvain Rochet
parent 5bddbdd914
commit 79f2200b27

View File

@ -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;