* [IP6IP6] Handle ECN correctly
@ 2004-09-09 3:45 Herbert Xu
2004-09-09 4:40 ` David S. Miller
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2004-09-09 3:45 UTC (permalink / raw)
To: David S. Miller, YOSHIFUJI Hideaki, vnourval, netdev
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
Hi:
This patch adds ECN encapsulation/decapsulation to ip6_tunnel.c.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1792 bytes --]
===== net/ipv6/ip6_tunnel.c 1.23 vs edited =====
--- 1.23/net/ipv6/ip6_tunnel.c 2004-06-22 07:34:06 +10:00
+++ edited/net/ipv6/ip6_tunnel.c 2004-09-09 13:34:19 +10:00
@@ -48,6 +48,8 @@
#include <net/addrconf.h>
#include <net/ip6_tunnel.h>
#include <net/xfrm.h>
+#include <net/dsfield.h>
+#include <net/inet_ecn.h>
MODULE_AUTHOR("Ville Nuorvala");
MODULE_DESCRIPTION("IPv6-in-IPv6 tunnel");
@@ -490,6 +492,15 @@
read_unlock(&ip6ip6_lock);
}
+static inline void ip6ip6_ecn_decapsulate(struct ipv6hdr *outer_iph,
+ struct sk_buff *skb)
+{
+ struct ipv6hdr *inner_iph = skb->nh.ipv6h;
+
+ if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
+ IP6_ECN_set_ce(inner_iph);
+}
+
/**
* ip6ip6_rcv - decapsulate IPv6 packet and retransmit it locally
* @skb: received socket buffer
@@ -531,6 +542,7 @@
skb->dev = t->dev;
dst_release(skb->dst);
skb->dst = NULL;
+ ip6ip6_ecn_decapsulate(ipv6h, skb);
t->stat.rx_packets++;
t->stat.rx_bytes += skb->len;
netif_rx(skb);
@@ -621,6 +633,7 @@
u8 proto;
int err;
int pkt_len;
+ int dsfield;
if (t->recursion++) {
stats->collisions++;
@@ -646,6 +659,7 @@
memcpy(&fl, &t->fl, sizeof (fl));
proto = fl.proto;
+ dsfield = ipv6_get_dsfield(ipv6h);
if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS))
fl.fl6_flowlabel |= (*(__u32 *) ipv6h & IPV6_TCLASS_MASK);
if ((t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL))
@@ -717,6 +731,8 @@
skb->nh.raw = skb_push(skb, sizeof(struct ipv6hdr));
ipv6h = skb->nh.ipv6h;
*(u32*)ipv6h = fl.fl6_flowlabel | htonl(0x60000000);
+ dsfield = INET_ECN_encapsulate(0, dsfield);
+ ipv6_change_dsfield(ipv6h, ~INET_ECN_MASK, dsfield);
ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
ipv6h->hop_limit = t->parms.hop_limit;
ipv6h->nexthdr = proto;
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 3:45 [IP6IP6] Handle ECN correctly Herbert Xu
@ 2004-09-09 4:40 ` David S. Miller
2004-09-09 4:43 ` Herbert Xu
0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2004-09-09 4:40 UTC (permalink / raw)
To: Herbert Xu; +Cc: yoshfuji, vnourval, netdev
On Thu, 9 Sep 2004 13:45:08 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> This patch adds ECN encapsulation/decapsulation to ip6_tunnel.c.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied, thanks Herbert.
How are those TTL encap fixes coming along? ;-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 4:40 ` David S. Miller
@ 2004-09-09 4:43 ` Herbert Xu
2004-09-09 4:49 ` David S. Miller
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2004-09-09 4:43 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Wed, Sep 08, 2004 at 09:40:23PM -0700, David S. Miller wrote:
>
> How are those TTL encap fixes coming along? ;-)
It went so well that you've already merged it :)
It's the last change on net/ipv*/xfrm*_output.c.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 4:43 ` Herbert Xu
@ 2004-09-09 4:49 ` David S. Miller
2004-09-09 4:54 ` Herbert Xu
2004-09-09 7:04 ` Pekka Savola
0 siblings, 2 replies; 10+ messages in thread
From: David S. Miller @ 2004-09-09 4:49 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Thu, 9 Sep 2004 14:43:36 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Wed, Sep 08, 2004 at 09:40:23PM -0700, David S. Miller wrote:
> >
> > How are those TTL encap fixes coming along? ;-)
>
> It went so well that you've already merged it :)
>
> It's the last change on net/ipv*/xfrm*_output.c.
We were going to make all the ipv4 tunnels offer encapsulation
behavior for these fields that matched the two major models
of behavior described in the IP tunneling RFCs.
Specifically I'm talking about the Uniform and the Pipe model
described in RFC-2983.
I would expect a change for that to occur in net/ipv4/ipip.c
or similar. :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 4:49 ` David S. Miller
@ 2004-09-09 4:54 ` Herbert Xu
2004-09-09 5:08 ` David S. Miller
2004-09-09 7:04 ` Pekka Savola
1 sibling, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2004-09-09 4:54 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Wed, Sep 08, 2004 at 09:49:26PM -0700, David S. Miller wrote:
>
> We were going to make all the ipv4 tunnels offer encapsulation
> behavior for these fields that matched the two major models
> of behavior described in the IP tunneling RFCs.
>
> Specifically I'm talking about the Uniform and the Pipe model
> described in RFC-2983.
You mean the TOS field?
> I would expect a change for that to occur in net/ipv4/ipip.c
> or similar. :)
OK, I'll take a look at this. I presume that the TOS options
in ip6tunnel.c is to your liking?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 4:54 ` Herbert Xu
@ 2004-09-09 5:08 ` David S. Miller
2004-09-10 0:31 ` Herbert Xu
0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2004-09-09 5:08 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Thu, 9 Sep 2004 14:54:15 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> > I would expect a change for that to occur in net/ipv4/ipip.c
> > or similar. :)
>
> OK, I'll take a look at this. I presume that the TOS options
> in ip6tunnel.c is to your liking?
It looks fine.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 4:49 ` David S. Miller
2004-09-09 4:54 ` Herbert Xu
@ 2004-09-09 7:04 ` Pekka Savola
1 sibling, 0 replies; 10+ messages in thread
From: Pekka Savola @ 2004-09-09 7:04 UTC (permalink / raw)
To: David S. Miller; +Cc: Herbert Xu, netdev
On Wed, 8 Sep 2004, David S. Miller wrote:
> We were going to make all the ipv4 tunnels offer encapsulation
> behavior for these fields that matched the two major models
> of behavior described in the IP tunneling RFCs.
>
> Specifically I'm talking about the Uniform and the Pipe model
> described in RFC-2983.
Now that we're talking about RFCs and tunnels, I'd like to point out
draft-ietf-v6ops-mech-v2-06.txt which replaces the old v6-in-v4
tunneling RFC, and is at the point of approval as RFC.
Sorry for hijacking the thread :)
--
Pekka Savola "You each name yourselves king, yet the
Netcore Oy kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-09 5:08 ` David S. Miller
@ 2004-09-10 0:31 ` Herbert Xu
2004-09-10 7:02 ` Herbert Xu
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2004-09-10 0:31 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Wed, Sep 08, 2004 at 10:08:02PM -0700, David S. Miller wrote:
>
> > > I would expect a change for that to occur in net/ipv4/ipip.c
> > > or similar. :)
> >
> > OK, I'll take a look at this. I presume that the TOS options
> > in ip6tunnel.c is to your liking?
>
> It looks fine.
Hmm, perhaps I'm still confused. But it seems that the ability to
set the TOS to any value other than *1 is already there for ipip/ip_gre.
That feature is missing for SIT and IPsec though.
We may also want to use the TOS value from parms to decide whether we want
to encapsulate/decapsulate ECN.
Is my understanding correct?
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-10 0:31 ` Herbert Xu
@ 2004-09-10 7:02 ` Herbert Xu
2004-09-10 21:58 ` David S. Miller
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2004-09-10 7:02 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Fri, Sep 10, 2004 at 10:31:58AM +1000, herbert wrote:
>
> Hmm, perhaps I'm still confused. But it seems that the ability to
> set the TOS to any value other than *1 is already there for ipip/ip_gre.
>
> That feature is missing for SIT and IPsec though.
>
> We may also want to use the TOS value from parms to decide whether we want
> to encapsulate/decapsulate ECN.
>
> Is my understanding correct?
Obviously not. Although we've got this stuff on the transmit side,
we don't do this on the receive side.
I'll look into it.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [IP6IP6] Handle ECN correctly
2004-09-10 7:02 ` Herbert Xu
@ 2004-09-10 21:58 ` David S. Miller
0 siblings, 0 replies; 10+ messages in thread
From: David S. Miller @ 2004-09-10 21:58 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Fri, 10 Sep 2004 17:02:42 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Fri, Sep 10, 2004 at 10:31:58AM +1000, herbert wrote:
> >
> > Hmm, perhaps I'm still confused. But it seems that the ability to
> > set the TOS to any value other than *1 is already there for ipip/ip_gre.
> >
> > That feature is missing for SIT and IPsec though.
> >
> > We may also want to use the TOS value from parms to decide whether we want
> > to encapsulate/decapsulate ECN.
> >
> > Is my understanding correct?
>
> Obviously not. Although we've got this stuff on the transmit side,
> we don't do this on the receive side.
That's right, on decap we don't provide a way to choose
the TOS selection.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2004-09-10 21:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-09 3:45 [IP6IP6] Handle ECN correctly Herbert Xu
2004-09-09 4:40 ` David S. Miller
2004-09-09 4:43 ` Herbert Xu
2004-09-09 4:49 ` David S. Miller
2004-09-09 4:54 ` Herbert Xu
2004-09-09 5:08 ` David S. Miller
2004-09-10 0:31 ` Herbert Xu
2004-09-10 7:02 ` Herbert Xu
2004-09-10 21:58 ` David S. Miller
2004-09-09 7:04 ` Pekka Savola
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).