From patchwork Thu Oct 1 18:08:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Ratiu X-Patchwork-Id: 34757 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2F6F3B7BD2 for ; Fri, 2 Oct 2009 04:09:05 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755954AbZJASIj (ORCPT ); Thu, 1 Oct 2009 14:08:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755788AbZJASIj (ORCPT ); Thu, 1 Oct 2009 14:08:39 -0400 Received: from ixro-out-rtc.ixiacom.com ([92.87.192.98]:30980 "EHLO ixro-ex1.ixiacom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755751AbZJASIi (ORCPT ); Thu, 1 Oct 2009 14:08:38 -0400 Received: from ixro-cratiu.localnet ([10.205.9.78]) by ixro-ex1.ixiacom.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 1 Oct 2009 21:08:41 +0300 From: Cosmin Ratiu Organization: IXIA To: David Miller Subject: Re: [PATCH] make TLLAO option for NA packets configurable Date: Thu, 1 Oct 2009 21:08:40 +0300 User-Agent: KMail/1.11.4 (Linux/2.6.30-1-686; KDE/4.2.4; i686; ; ) Cc: shemminger@vyatta.com, netdev@vger.kernel.org, opurdila@ixiacom.com References: <200910011916.40908.cratiu@ixiacom.com> <20091001092100.14ea024b@s6510> <20091001.094356.95174955.davem@davemloft.net> In-Reply-To: <20091001.094356.95174955.davem@davemloft.net> MIME-Version: 1.0 Message-Id: <200910012108.41071.cratiu@ixiacom.com> X-OriginalArrivalTime: 01 Oct 2009 18:08:41.0684 (UTC) FILETIME=[352EF940:01CA42C2] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. From 1911a98df800cedf4c3a63b897163e2935c5f602 Mon Sep 17 00:00:00 2001 From: Cosmin Ratiu 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 --- 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