diff mbox

make TLLAO option for NA packets configurable

Message ID 200910012108.41071.cratiu@ixiacom.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Cosmin Ratiu Oct. 1, 2009, 6:08 p.m. UTC
On Thursday 01 October 2009 19:43:56 David Miller wrote:
> Using CLT_UNNUMBERED is a must these days.
>
> Also, please fix the prefixing of the paths in your patch.
> See Documentation/SubmittingPatches in the kernel tree.

Here is the new variant. Please let me know what you think.

And I apologize for using [PATCH] instead of [RFC] in the subject, I don't 
know much about netdev protocol (yet).

Cosmin.

Comments

stephen hemminger Oct. 1, 2009, 6:14 p.m. UTC | #1
On Thu, 1 Oct 2009 21:08:40 +0300
Cosmin Ratiu <cratiu@ixiacom.com> wrote:

> On Thursday 01 October 2009 19:43:56 David Miller wrote:
> > Using CLT_UNNUMBERED is a must these days.
> >
> > Also, please fix the prefixing of the paths in your patch.
> > See Documentation/SubmittingPatches in the kernel tree.
> 
> Here is the new variant. Please let me know what you think.
> 
> And I apologize for using [PATCH] instead of [RFC] in the subject, I don't 
> know much about netdev protocol (yet).
> 
> Cosmin.

Probably this should be a per interface property rather than per namespace.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Octavian Purdila Oct. 1, 2009, 6:39 p.m. UTC | #2
On Thursday 01 October 2009 21:14:50 you wrote:
> 
> Probably this should be a per interface property rather than per namespace.

In our case, where we have lots of interfaces active, it would be nice to have 
the per namespace property as well.

But, as Cosmin suggested, perhaps it would be better to just send this options 
by default? (its a RFC SHOULD after all...)

Thanks,
tavi
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger Oct. 1, 2009, 6:56 p.m. UTC | #3
On Thu, 1 Oct 2009 21:39:32 +0300
Octavian Purdila <opurdila@ixiacom.com> wrote:

> On Thursday 01 October 2009 21:14:50 you wrote:
> > 
> > Probably this should be a per interface property rather than per namespace.
> 
> In our case, where we have lots of interfaces active, it would be nice to have 
> the per namespace property as well.

The ipv6 control infrastructure already has that option. If you changed your
patch to use a per-interface control then there would be:

  /proc/sys/net/ipv6/conf/all/force_tllao
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 1, 2009, 7:37 p.m. UTC | #4
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 1 Oct 2009 11:56:11 -0700

> On Thu, 1 Oct 2009 21:39:32 +0300
> Octavian Purdila <opurdila@ixiacom.com> wrote:
> 
>> On Thursday 01 October 2009 21:14:50 you wrote:
>> > 
>> > Probably this should be a per interface property rather than per namespace.
>> 
>> In our case, where we have lots of interfaces active, it would be nice to have 
>> the per namespace property as well.
> 
> The ipv6 control infrastructure already has that option. If you changed your
> patch to use a per-interface control then there would be:
> 
>   /proc/sys/net/ipv6/conf/all/force_tllao

Right, this would work a lot better.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 1911a98df800cedf4c3a63b897163e2935c5f602 Mon Sep 17 00:00:00 2001
From: Cosmin Ratiu <cratiu@ixiacom.com>
Date: Thu, 1 Oct 2009 20:27:39 +0300
Subject: [PATCH] ipv6: new sysctl for sending TLLAO with NAs

Neighbor advertisements responding to unicast Neighbor Solicitations did
not include the TLLAO option. This patch makes this configurable via
/proc/sys/net/ipv6/ndisc_force_tllao, which by default is off.

The need for this arose because certain routers expect the TLLAO in some
situations even as a response to unicast NS packets.

Moreover, RFC 2461 recommends on page 24 sending this to avoid a race.

Signed-off-by: Cosmin Ratiu <cratiu@ixiacom.com>
---
 include/net/netns/ipv6.h   |    1 +
 net/ipv6/ndisc.c           |    1 +
 net/ipv6/sysctl_net_ipv6.c |    8 ++++++++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index dfeb2d7..dd0a95b 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -16,6 +16,7 @@  struct netns_sysctl_ipv6 {
 	struct ctl_table_header *frags_hdr;
 #endif
 	int bindv6only;
+	int ndisc_force_tllao;
 	int flush_delay;
 	int ip6_rt_max_size;
 	int ip6_rt_gc_min_interval;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f74e4e2..f08cf65 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -598,6 +598,7 @@  static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
 	icmp6h.icmp6_solicited = solicited;
 	icmp6h.icmp6_override = override;
 
+	inc_opt |= dev_net(dev)->ipv6.sysctl.ndisc_force_tllao;
 	__ndisc_send(dev, neigh, daddr, src_addr,
 		     &icmp6h, solicited_addr,
 		     inc_opt ? ND_OPT_TARGET_LL_ADDR : 0);
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 0dc6a4e..fb423ce 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -37,6 +37,14 @@  static ctl_table ipv6_table_template[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec
 	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "ndisc_force_tllao",
+		.data		= &init_net.ipv6.sysctl.ndisc_force_tllao,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec
+	},
 	{ .ctl_name = 0 }
 };
 
-- 
1.6.3.3