* PATCH: [SKBUFF] Introduce skb_set_link_header_offset(skb, offset)
@ 2004-10-05 20:09 Arnaldo Carvalho de Melo
2004-10-05 20:53 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-10-05 20:09 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 160 bytes --]
Hi David,
Please consider pulling from:
bk://kernel.bkbits.net/acme/sk_buff-2.4
Now there are 14 outstanding changesets in this tree.
Regards,
- Arnaldo
[-- Attachment #2: skb_set_link_header_offset.patch --]
[-- Type: text/plain, Size: 2859 bytes --]
===================================================================
ChangeSet@1.2043, 2004-10-05 17:05:20-03:00, acme@conectiva.com.br
[SKBUFF] Introduce skb_set_link_header_offset(skb, offset)
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@redhat.com>
drivers/net/loopback.c | 2 +-
drivers/net/myri_sbus.c | 2 +-
drivers/s390/net/qeth_main.c | 2 +-
include/linux/skbuff.h | 6 ++++++
net/atm/br2684.c | 2 +-
5 files changed, 10 insertions(+), 4 deletions(-)
diff -Nru a/drivers/net/loopback.c b/drivers/net/loopback.c
--- a/drivers/net/loopback.c 2004-10-05 17:06:15 -03:00
+++ b/drivers/net/loopback.c 2004-10-05 17:06:15 -03:00
@@ -85,7 +85,7 @@
if (!nskb)
break;
skb_reserve(nskb, 32);
- nskb->mac.raw = nskb->data - ETH_HLEN;
+ skb_set_link_header_offset(nskb, -ETH_HLEN);
nskb->nh.raw = nskb->data;
iph = nskb->nh.iph;
memcpy(nskb->data, skb->nh.raw, doffset);
diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
--- a/drivers/net/myri_sbus.c 2004-10-05 17:06:15 -03:00
+++ b/drivers/net/myri_sbus.c 2004-10-05 17:06:15 -03:00
@@ -374,7 +374,7 @@
struct ethhdr *eth;
unsigned char *rawp;
- skb->mac.raw = (((unsigned char *)skb->data) + MYRI_PAD_LEN);
+ skb_set_link_header_offset(skb, MYRI_PAD_LEN);
skb_pull(skb, dev->hard_header_len);
eth = eth_hdr(skb);
diff -Nru a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
--- a/drivers/s390/net/qeth_main.c 2004-10-05 17:06:15 -03:00
+++ b/drivers/s390/net/qeth_main.c 2004-10-05 17:06:15 -03:00
@@ -2173,7 +2173,7 @@
struct iphdr *ip_hdr;
QETH_DBF_TEXT(trace,5,"skbfake");
- skb->mac.raw = skb->data - QETH_FAKE_LL_LEN;
+ skb_set_link_header_offset(skb, -QETH_FAKE_LL_LEN);
/* this is a fake ethernet header */
fake_hdr = eth_hdr(skb);
diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h 2004-10-05 17:06:15 -03:00
+++ b/include/linux/skbuff.h 2004-10-05 17:06:15 -03:00
@@ -295,6 +295,12 @@
skb->mac.raw = skb->data;
}
+static inline void skb_set_link_header_offset(struct sk_buff *skb,
+ const int offset)
+{
+ skb->mac.raw = skb->data + offset;
+}
+
static inline int skb_valid_link_header(const struct sk_buff *skb,
const int hdrlen)
{
diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c
--- a/net/atm/br2684.c 2004-10-05 17:06:15 -03:00
+++ b/net/atm/br2684.c 2004-10-05 17:06:15 -03:00
@@ -460,7 +460,7 @@
/* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
than should be. What else should I set? */
skb_pull(skb, plen);
- skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN;
+ skb_set_link_header_offset(skb, -ETH_HLEN);
skb->pkt_type = PACKET_HOST;
#ifdef CONFIG_BR2684_FAST_TRANS
skb->protocol = ((u16 *) skb->data)[-1];
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: PATCH: [SKBUFF] Introduce skb_set_link_header_offset(skb, offset)
2004-10-05 20:09 PATCH: [SKBUFF] Introduce skb_set_link_header_offset(skb, offset) Arnaldo Carvalho de Melo
@ 2004-10-05 20:53 ` David S. Miller
2004-10-05 21:25 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2004-10-05 20:53 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: netdev
On Tue, 05 Oct 2004 17:09:08 -0300
Arnaldo Carvalho de Melo <acme@conectiva.com.br> wrote:
> Hi David,
>
> Please consider pulling from:
>
> bk://kernel.bkbits.net/acme/sk_buff-2.4
>
> Now there are 14 outstanding changesets in this tree.
Slow down. :-)
There are bugs in your earlier changesets which are going
to make it hard for me to pull this tree in. Let's work
one or two changesets at a time, not 14 ok? :-)
First bug, in ChangeSet 1.2032, drivers/net/wireless/orinoco.c
You change "skb->mac.raw + ETH_ALEN" into
"eth_hdr(skb)->h_source". That can't be right
since orinoco_spy_gather() expects a pointer for
that argument.
Same error in the drivers/net/wireless/wavelan.c change
in ChangeSet 1.2032, replacing skb->mac.raw (a pointer)
with eth_hdr(skb)->h_dest in the call to wv_packet_info.
And then "skb->mac.raw + WAVELAN_ADDR_SIZE" into
"eth_hdr(skb)->h_source" in the call to wl_spy_gather().
The same errors occur all the changes to
drivers/net/wireless/wavelan_cs.c of the same ChangeSet.
Please start to submit this stuff in smaller pieces and
fix the above bugs, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: [SKBUFF] Introduce skb_set_link_header_offset(skb, offset)
2004-10-05 20:53 ` David S. Miller
@ 2004-10-05 21:25 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-10-05 21:25 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
David S. Miller wrote:
> On Tue, 05 Oct 2004 17:09:08 -0300
> Arnaldo Carvalho de Melo <acme@conectiva.com.br> wrote:
>
>
>>Hi David,
>>
>> Please consider pulling from:
>>
>>bk://kernel.bkbits.net/acme/sk_buff-2.4
>>
>> Now there are 14 outstanding changesets in this tree.
>
>
> Slow down. :-)
Oh, flow control! :-)
>
> There are bugs in your earlier changesets which are going
> to make it hard for me to pull this tree in. Let's work
> one or two changesets at a time, not 14 ok? :-)
>
> First bug, in ChangeSet 1.2032, drivers/net/wireless/orinoco.c
>
> You change "skb->mac.raw + ETH_ALEN" into
> "eth_hdr(skb)->h_source". That can't be right
> since orinoco_spy_gather() expects a pointer for
> that argument.
>
> Same error in the drivers/net/wireless/wavelan.c change
> in ChangeSet 1.2032, replacing skb->mac.raw (a pointer)
> with eth_hdr(skb)->h_dest in the call to wv_packet_info.
humm, puzzled, isn't eth_hdr(skb)->h_dest a pointer of the
same tipe (unsigned char *), that points to same place as
skb->mac.raw? :-)
But perhaps the guy wanted the whole link header, I got
confused because afterwards it uses the ETH_ALEN offset,
meaning that it wanted now the second struct ethhdr field,
lemme look again at this code...
Nope, you're right, seems to be the 802.11 three adresses stuff,
done in an ad-hoc confusing way, my mistake.
> Please start to submit this stuff in smaller pieces and
> fix the above bugs, thanks.
mmkay sir!
Best Regards,
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-10-05 21:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-05 20:09 PATCH: [SKBUFF] Introduce skb_set_link_header_offset(skb, offset) Arnaldo Carvalho de Melo
2004-10-05 20:53 ` David S. Miller
2004-10-05 21:25 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).