aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-05-18 16:23:00 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-19 02:32:30 -0400
commit968d70184d599abc7fe0a89447ef4e183e0135c4 (patch)
tree802783219bef73069906164aa4d6b6a67aab9f7d /drivers/net/ppp
parenta50feda546ac03415707a9bbcac8d6b20714db21 (diff)
ppp: avoid false drop_monitor false positives
Call consume_skb() in place of kfree_skb() were appropriate. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r--drivers/net/ppp/ppp_async.c2
-rw-r--r--drivers/net/ppp/ppp_generic.c14
-rw-r--r--drivers/net/ppp/ppp_synctty.c4
-rw-r--r--drivers/net/ppp/pppoe.c6
-rw-r--r--drivers/net/ppp/pptp.c2
5 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index af95a98fd86f..a031f6b456b4 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -613,7 +613,7 @@ ppp_async_encode(struct asyncppp *ap)
613 *buf++ = PPP_FLAG; 613 *buf++ = PPP_FLAG;
614 ap->olim = buf; 614 ap->olim = buf;
615 615
616 kfree_skb(ap->tpkt); 616 consume_skb(ap->tpkt);
617 ap->tpkt = NULL; 617 ap->tpkt = NULL;
618 return 1; 618 return 1;
619} 619}
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 21d7151fb0ab..5c0557222f20 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1092,13 +1092,13 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
1092 new_skb->data, skb->len + 2, 1092 new_skb->data, skb->len + 2,
1093 compressor_skb_size); 1093 compressor_skb_size);
1094 if (len > 0 && (ppp->flags & SC_CCP_UP)) { 1094 if (len > 0 && (ppp->flags & SC_CCP_UP)) {
1095 kfree_skb(skb); 1095 consume_skb(skb);
1096 skb = new_skb; 1096 skb = new_skb;
1097 skb_put(skb, len); 1097 skb_put(skb, len);
1098 skb_pull(skb, 2); /* pull off A/C bytes */ 1098 skb_pull(skb, 2); /* pull off A/C bytes */
1099 } else if (len == 0) { 1099 } else if (len == 0) {
1100 /* didn't compress, or CCP not up yet */ 1100 /* didn't compress, or CCP not up yet */
1101 kfree_skb(new_skb); 1101 consume_skb(new_skb);
1102 new_skb = skb; 1102 new_skb = skb;
1103 } else { 1103 } else {
1104 /* 1104 /*
@@ -1112,7 +1112,7 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
1112 if (net_ratelimit()) 1112 if (net_ratelimit())
1113 netdev_err(ppp->dev, "ppp: compressor dropped pkt\n"); 1113 netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
1114 kfree_skb(skb); 1114 kfree_skb(skb);
1115 kfree_skb(new_skb); 1115 consume_skb(new_skb);
1116 new_skb = NULL; 1116 new_skb = NULL;
1117 } 1117 }
1118 return new_skb; 1118 return new_skb;
@@ -1178,7 +1178,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
1178 !(ppp->flags & SC_NO_TCP_CCID)); 1178 !(ppp->flags & SC_NO_TCP_CCID));
1179 if (cp == skb->data + 2) { 1179 if (cp == skb->data + 2) {
1180 /* didn't compress */ 1180 /* didn't compress */
1181 kfree_skb(new_skb); 1181 consume_skb(new_skb);
1182 } else { 1182 } else {
1183 if (cp[0] & SL_TYPE_COMPRESSED_TCP) { 1183 if (cp[0] & SL_TYPE_COMPRESSED_TCP) {
1184 proto = PPP_VJC_COMP; 1184 proto = PPP_VJC_COMP;
@@ -1187,7 +1187,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
1187 proto = PPP_VJC_UNCOMP; 1187 proto = PPP_VJC_UNCOMP;
1188 cp[0] = skb->data[2]; 1188 cp[0] = skb->data[2];
1189 } 1189 }
1190 kfree_skb(skb); 1190 consume_skb(skb);
1191 skb = new_skb; 1191 skb = new_skb;
1192 cp = skb_put(skb, len + 2); 1192 cp = skb_put(skb, len + 2);
1193 cp[0] = 0; 1193 cp[0] = 0;
@@ -1703,7 +1703,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
1703 } 1703 }
1704 skb_reserve(ns, 2); 1704 skb_reserve(ns, 2);
1705 skb_copy_bits(skb, 0, skb_put(ns, skb->len), skb->len); 1705 skb_copy_bits(skb, 0, skb_put(ns, skb->len), skb->len);
1706 kfree_skb(skb); 1706 consume_skb(skb);
1707 skb = ns; 1707 skb = ns;
1708 } 1708 }
1709 else 1709 else
@@ -1851,7 +1851,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
1851 goto err; 1851 goto err;
1852 } 1852 }
1853 1853
1854 kfree_skb(skb); 1854 consume_skb(skb);
1855 skb = ns; 1855 skb = ns;
1856 skb_put(skb, len); 1856 skb_put(skb, len);
1857 skb_pull(skb, 2); /* pull off the A/C bytes */ 1857 skb_pull(skb, 2); /* pull off the A/C bytes */
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c
index 55e466c511d5..1a12033d2efa 100644
--- a/drivers/net/ppp/ppp_synctty.c
+++ b/drivers/net/ppp/ppp_synctty.c
@@ -588,7 +588,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
588 skb_reserve(npkt,2); 588 skb_reserve(npkt,2);
589 skb_copy_from_linear_data(skb, 589 skb_copy_from_linear_data(skb,
590 skb_put(npkt, skb->len), skb->len); 590 skb_put(npkt, skb->len), skb->len);
591 kfree_skb(skb); 591 consume_skb(skb);
592 skb = npkt; 592 skb = npkt;
593 } 593 }
594 skb_push(skb,2); 594 skb_push(skb,2);
@@ -656,7 +656,7 @@ ppp_sync_push(struct syncppp *ap)
656 if (sent < ap->tpkt->len) { 656 if (sent < ap->tpkt->len) {
657 tty_stuffed = 1; 657 tty_stuffed = 1;
658 } else { 658 } else {
659 kfree_skb(ap->tpkt); 659 consume_skb(ap->tpkt);
660 ap->tpkt = NULL; 660 ap->tpkt = NULL;
661 clear_bit(XMIT_FULL, &ap->xmit_flags); 661 clear_bit(XMIT_FULL, &ap->xmit_flags);
662 done = 1; 662 done = 1;
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index dd15b8f8aa0c..cbf7047decc0 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -984,8 +984,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
984 if (skb) { 984 if (skb) {
985 total_len = min_t(size_t, total_len, skb->len); 985 total_len = min_t(size_t, total_len, skb->len);
986 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); 986 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
987 if (error == 0) 987 if (error == 0) {
988 error = total_len; 988 consume_skb(skb);
989 return total_len;
990 }
989 } 991 }
990 992
991 kfree_skb(skb); 993 kfree_skb(skb);
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 72b50f57e7b2..1c98321b56cc 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -209,7 +209,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
209 } 209 }
210 if (skb->sk) 210 if (skb->sk)
211 skb_set_owner_w(new_skb, skb->sk); 211 skb_set_owner_w(new_skb, skb->sk);
212 kfree_skb(skb); 212 consume_skb(skb);
213 skb = new_skb; 213 skb = new_skb;
214 } 214 }
215 215