Thread (22 messages) 22 messages, 4 authors, 2007-08-06

Re: [PATCH net-2.6.22-rc7] xfrm beet interfamily support

From: David Miller <davem@davemloft.net>
Date: 2007-07-18 09:18:16

From: "Arnaldo Carvalho de Melo" <redacted>
Date: Mon, 16 Jul 2007 09:56:59 -0300
Sorry for not commented that the code you were using (and David said
it was invalid) is in fact valid:

            skb->transport_header = skb->network_header;

This works for both offsets and pointers, i.e. both transport_header
and network_header are in the same "address space".


             skb_set_transport_header(skb, skb_network_offset(skb));

Also works, but its too convoluted IMHO, for pointers it would reduce to:

              skb->transport_header = skb->data + skb->network_header
- skb->data;

for offsets:

              skb->transport_header = skb->data - skb->head;
              skb->transport_header += skb->head + skb->network_header
- skb->data;

I.e. both reduce to:

               skb->transport_header = skb->network_header;

Some more comments below, but I think this time, sans the above
possible cleanup, your patch is OK wrt offsets/pointers.
Thanks for the correction, indeed you are correct :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help