Commit 968d7018 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ppp: avoid false drop_monitor false positives

Call consume_skb() in place of kfree_skb() were appropriate.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a50feda5
...@@ -613,7 +613,7 @@ ppp_async_encode(struct asyncppp *ap) ...@@ -613,7 +613,7 @@ ppp_async_encode(struct asyncppp *ap)
*buf++ = PPP_FLAG; *buf++ = PPP_FLAG;
ap->olim = buf; ap->olim = buf;
kfree_skb(ap->tpkt); consume_skb(ap->tpkt);
ap->tpkt = NULL; ap->tpkt = NULL;
return 1; return 1;
} }
......
...@@ -1092,13 +1092,13 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb) ...@@ -1092,13 +1092,13 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
new_skb->data, skb->len + 2, new_skb->data, skb->len + 2,
compressor_skb_size); compressor_skb_size);
if (len > 0 && (ppp->flags & SC_CCP_UP)) { if (len > 0 && (ppp->flags & SC_CCP_UP)) {
kfree_skb(skb); consume_skb(skb);
skb = new_skb; skb = new_skb;
skb_put(skb, len); skb_put(skb, len);
skb_pull(skb, 2); /* pull off A/C bytes */ skb_pull(skb, 2); /* pull off A/C bytes */
} else if (len == 0) { } else if (len == 0) {
/* didn't compress, or CCP not up yet */ /* didn't compress, or CCP not up yet */
kfree_skb(new_skb); consume_skb(new_skb);
new_skb = skb; new_skb = skb;
} else { } else {
/* /*
...@@ -1112,7 +1112,7 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb) ...@@ -1112,7 +1112,7 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
if (net_ratelimit()) if (net_ratelimit())
netdev_err(ppp->dev, "ppp: compressor dropped pkt\n"); netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
kfree_skb(skb); kfree_skb(skb);
kfree_skb(new_skb); consume_skb(new_skb);
new_skb = NULL; new_skb = NULL;
} }
return new_skb; return new_skb;
...@@ -1178,7 +1178,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb) ...@@ -1178,7 +1178,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
!(ppp->flags & SC_NO_TCP_CCID)); !(ppp->flags & SC_NO_TCP_CCID));
if (cp == skb->data + 2) { if (cp == skb->data + 2) {
/* didn't compress */ /* didn't compress */
kfree_skb(new_skb); consume_skb(new_skb);
} else { } else {
if (cp[0] & SL_TYPE_COMPRESSED_TCP) { if (cp[0] & SL_TYPE_COMPRESSED_TCP) {
proto = PPP_VJC_COMP; proto = PPP_VJC_COMP;
...@@ -1187,7 +1187,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb) ...@@ -1187,7 +1187,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
proto = PPP_VJC_UNCOMP; proto = PPP_VJC_UNCOMP;
cp[0] = skb->data[2]; cp[0] = skb->data[2];
} }
kfree_skb(skb); consume_skb(skb);
skb = new_skb; skb = new_skb;
cp = skb_put(skb, len + 2); cp = skb_put(skb, len + 2);
cp[0] = 0; cp[0] = 0;
...@@ -1703,7 +1703,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb) ...@@ -1703,7 +1703,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
} }
skb_reserve(ns, 2); skb_reserve(ns, 2);
skb_copy_bits(skb, 0, skb_put(ns, skb->len), skb->len); skb_copy_bits(skb, 0, skb_put(ns, skb->len), skb->len);
kfree_skb(skb); consume_skb(skb);
skb = ns; skb = ns;
} }
else else
...@@ -1851,7 +1851,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb) ...@@ -1851,7 +1851,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
goto err; goto err;
} }
kfree_skb(skb); consume_skb(skb);
skb = ns; skb = ns;
skb_put(skb, len); skb_put(skb, len);
skb_pull(skb, 2); /* pull off the A/C bytes */ skb_pull(skb, 2); /* pull off the A/C bytes */
......
...@@ -588,7 +588,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb) ...@@ -588,7 +588,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
skb_reserve(npkt,2); skb_reserve(npkt,2);
skb_copy_from_linear_data(skb, skb_copy_from_linear_data(skb,
skb_put(npkt, skb->len), skb->len); skb_put(npkt, skb->len), skb->len);
kfree_skb(skb); consume_skb(skb);
skb = npkt; skb = npkt;
} }
skb_push(skb,2); skb_push(skb,2);
...@@ -656,7 +656,7 @@ ppp_sync_push(struct syncppp *ap) ...@@ -656,7 +656,7 @@ ppp_sync_push(struct syncppp *ap)
if (sent < ap->tpkt->len) { if (sent < ap->tpkt->len) {
tty_stuffed = 1; tty_stuffed = 1;
} else { } else {
kfree_skb(ap->tpkt); consume_skb(ap->tpkt);
ap->tpkt = NULL; ap->tpkt = NULL;
clear_bit(XMIT_FULL, &ap->xmit_flags); clear_bit(XMIT_FULL, &ap->xmit_flags);
done = 1; done = 1;
......
...@@ -984,8 +984,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -984,8 +984,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
if (skb) { if (skb) {
total_len = min_t(size_t, total_len, skb->len); total_len = min_t(size_t, total_len, skb->len);
error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
if (error == 0) if (error == 0) {
error = total_len; consume_skb(skb);
return total_len;
}
} }
kfree_skb(skb); kfree_skb(skb);
......
...@@ -209,7 +209,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) ...@@ -209,7 +209,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
} }
if (skb->sk) if (skb->sk)
skb_set_owner_w(new_skb, skb->sk); skb_set_owner_w(new_skb, skb->sk);
kfree_skb(skb); consume_skb(skb);
skb = new_skb; skb = new_skb;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment