From: Andi Kleen <ak@muc.de>
To: netdev@oss.sgi.com
Cc: mostrows@speakeasy.net, paulus@au.ibm.com
Subject: [PATCH] Convert pppoe to new style protocol
Date: Wed, 18 Jun 2003 00:04:20 +0200 [thread overview]
Message-ID: <20030617220420.GA1169@averell> (raw)
Convert pppoe to a new style protocol, otherwise it is unusable
on SMP compiled kernels because of the printk in deliver*old_ones.
It works fine here, but only tested on a UP box.
I checked with paulus and he confirmed that ppp_input is safe
to be called with the new softirq semantics. The PPP path also
appears to work with shared skbs (never modify skb data,
not 100% audited however) but not with non linear skbs.
The pppoe code itself is safe because it never uses timers
or does anything complicated.
If someone knows a place in ppp_input that modifies the data
area then please contain now so that a skb_copy can be added.
-Andi
diff -u linux-2.5.72-work/drivers/net/pppoe.c-o linux-2.5.72-work/drivers/net/pppoe.c
--- linux-2.5.72-work/drivers/net/pppoe.c-o 2003-06-14 23:42:51.000000000 +0200
+++ linux-2.5.72-work/drivers/net/pppoe.c 2003-06-17 23:15:11.000000000 +0200
@@ -348,6 +348,9 @@
struct pppox_opt *po = pppox_sk(sk);
struct pppox_opt *relay_po = NULL;
+ if (skb_is_nonlinear(skb) && skb_linearize(skb, GFP_ATOMIC))
+ goto abort_kfree;
+
if (sk->sk_state & PPPOX_BOUND) {
skb_pull(skb, sizeof(struct pppoe_hdr));
ppp_input(&po->chan, skb);
@@ -463,11 +466,13 @@
struct packet_type pppoes_ptype = {
.type = __constant_htons(ETH_P_PPP_SES),
.func = pppoe_rcv,
+ .data = (void*) 1,
};
struct packet_type pppoed_ptype = {
.type = __constant_htons(ETH_P_PPP_DISC),
.func = pppoe_disc_rcv,
+ .data = (void*) 1,
};
/***********************************************************************
next reply other threads:[~2003-06-17 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-17 22:04 Andi Kleen [this message]
2003-06-17 22:07 ` [PATCH] Convert pppoe to new style protocol David S. Miller
2003-06-18 8:01 ` Andi Kleen
2003-06-18 12:21 ` Werner Almesberger
2003-06-18 12:51 ` Andi Kleen
2003-06-18 17:21 ` David S. Miller
2003-06-18 23:36 ` David S. Miller
2003-06-18 17:15 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030617220420.GA1169@averell \
--to=ak@muc.de \
--cc=mostrows@speakeasy.net \
--cc=netdev@oss.sgi.com \
--cc=paulus@au.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.