22 May 2013 13:32
[PATCH v3 1/4] ppp: adds new decompressor error code to signal that packet must be dropped
Jorge Boncompte [DTI2] <jorge <at> dti2.net>
2013-05-22 11:32:50 GMT
2013-05-22 11:32:50 GMT
From: "Jorge Boncompte [DTI2]" <jorge <at> dti2.net>
Currently decompressors can't signal the generic PPP layer to silently
drop a packet without notifying the PPP daemon or the other party.
Signed-off-by: Jorge Boncompte [DTI2] <jorge <at> dti2.net>
---
drivers/net/ppp/ppp_generic.c | 12 ++++++++++++
include/linux/ppp-comp.h | 6 ++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 72ff14b..7d26825 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
<at> <at> -1729,6 +1729,10 <at> <at> ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
(ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0)
skb = ppp_decompress_frame(ppp, skb);
+ /* Packet dropped */
+ if (skb == NULL)
+ goto err;
+
if (ppp->flags & SC_MUST_COMP && ppp->rstate & SC_DC_FERROR)
goto err;
<at> <at> -1888,6 +1892,13 <at> <at> ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2,
skb->len + 2, ns->data, obuff_size);
if (len < 0) {
(Continue reading)
RSS Feed