Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-24 Thread Alexey Kuznetsov
Hello!

 I was able to set a nbma gre tunnel, add routes to it and it worked
 perfectly ok.
 
 Link-level next hop worked:
 ip route add route via link-level-address dev tunnel-dev onlink

This can work if you use gre0. By plain luck it has all-zero dev_addr.

It will break on nbma devices set with:

ip tunnel add XXX mode gre local a.b.c.d [key whatever] ...

Alexey
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread Patrick McHardy

Timo Teräs wrote:

When GRE tunnel is in NBMA mode, this patch allows an application to use
a PF_PACKET socket to:
- send a packet to specific NBMA address with sendto()
- use recvfrom() to receive packet and check which NBMA address it came 
from


Signed-off-by: Timo Teras [EMAIL PROTECTED]

---

This is useful for implementing NHRP (and other low level protocols) over
NBMA GRE tunnels.

Posted about a week ago, but got no reply. Could someone comment on this?
Or commit it? Thanks.



Your mailer mangled tabs, it won't apply like this. Try sending to
yourself for testing, then repost when it works properly.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread Patrick McHardy

Timo Teräs wrote:

When GRE tunnel is in NBMA mode, this patch allows an application to use
a PF_PACKET socket to:
- send a packet to specific NBMA address with sendto()
- use recvfrom() to receive packet and check which NBMA address it 
came from


This is required to implement properly NHRP over GRE tunnel.

Signed-off-by: Timo Teras [EMAIL PROTECTED]

---
Patrick McHardy wrote:

Your mailer mangled tabs, it won't apply like this. Try sending to
yourself for testing, then repost when it works properly.


Tabs were ok, I think. But somehow it seems that cut'n'paste from my
default editor loses the space from context lines. It should be good now.


Might have been a problem on my side, I just updated my mailer
and it still displays tabs broken, but the actual patch seems
fine. Sorry for the noise ...


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread Alexey Kuznetsov
Hello!

 When GRE tunnel is in NBMA mode, this patch allows an application to use
 a PF_PACKET socket to:
 - send a packet to specific NBMA address with sendto()
 - use recvfrom() to receive packet and check which NBMA address it came from
 
 This is required to implement properly NHRP over GRE tunnel.

Ack. This is good idea.

Frankly, I was sure ip_gre worked in this way all these years.
I do not remember any reasons why it was crippled.

The only dubious case is when next hop is set using routing tables.
But code in ipgre_tunnel_xmit() is ready to accept this situation,
it checks for zero destination address and fixes it when it is able to.

Alexey
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread Alexey Kuznetsov
Hello!

Me wrote:

 Ack. This is good idea.
 
 Frankly, I was sure ip_gre worked in this way all these years.
 I do not remember any reasons why it was crippled.
 
 The only dubious case is when next hop is set using routing tables.
 But code in ipgre_tunnel_xmit() is ready to accept this situation,
 it checks for zero destination address and fixes it when it is able to.

Nevertheless, it does not work.

The reason is that NOARP arp entries on device with initialized
hard_header are initialized not to all zeros, but to dev-dev_addr.
So that, netxthop from routing tables is ignored and all gre packets
are lost in loopback. Not good.

The problem can be ignored. I am even not sure that someone uses
this feature. Actually, it was not recommended in documentation.

Alternatively, arp.c can be changed to generate 0 addresses instead
of dev-dev_addr. Normally it is equally good, but I am not sure
about possible side effects.

Another thoughts?

Alexey
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread David Miller
From: Alexey Kuznetsov [EMAIL PROTECTED]
Date: Tue, 23 Oct 2007 23:03:24 +0400

 Hello!
 
  When GRE tunnel is in NBMA mode, this patch allows an application to use
  a PF_PACKET socket to:
  - send a packet to specific NBMA address with sendto()
  - use recvfrom() to receive packet and check which NBMA address it came from
  
  This is required to implement properly NHRP over GRE tunnel.
 
 Ack. This is good idea.

Patch applied, thanks everyone!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-23 Thread Timo Teräs

Hi,

Alexey Kuznetsov wrote:

The only dubious case is when next hop is set using routing tables.
But code in ipgre_tunnel_xmit() is ready to accept this situation,
it checks for zero destination address and fixes it when it is able to.


Nevertheless, it does not work.

Another thoughts?


Could you explain this a little more?

I was able to set a nbma gre tunnel, add routes to it and it worked
perfectly ok.

Link-level next hop worked:
ip route add route via link-level-address dev tunnel-dev onlink

Also normal route with static neighbor worked:
ip neigh add router-tunnel-ip lladdr link-level-address nud permanent dev 
tunnel-dev
ip route add route via router-tunnel-ip

In both cases packets were routed as expected to hosts accessible using
the added route. And sendto() sent a packet correctly with destination
link-level-address set. Did I miss/misunderstand something?

Cheers,
 Timo
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html