From patchwork Sun Dec 12 13:43:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Ossman X-Patchwork-Id: 75243 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.180.67]) by ozlabs.org (Postfix) with ESMTP id B6F5CB7093 for ; Mon, 13 Dec 2010 00:48:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656Ab0LLNss (ORCPT ); Sun, 12 Dec 2010 08:48:48 -0500 Received: from 82-117-125-11.tcdsl.calypso.net ([82.117.125.11]:55611 "EHLO smtp.ossman.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131Ab0LLNss (ORCPT ); Sun, 12 Dec 2010 08:48:48 -0500 X-Greylist: delayed 336 seconds by postgrey-1.27 at vger.kernel.org; Sun, 12 Dec 2010 08:48:47 EST Received: from mjolnir.ossman.eu ([2001:16d8:ff07:2:21d:e0ff:fe88:be11]) (AUTH: LOGIN drzeus, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by smtp.ossman.eu with esmtp; Sun, 12 Dec 2010 14:43:06 +0100 id 0000000000120433.000000004D04D16A.00005CC6 Date: Sun, 12 Dec 2010 14:43:00 +0100 From: Pierre Ossman To: netdev@vger.kernel.org Cc: "David S. Miller" , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , Patrick McHardy Subject: [RFC][PATCH] Export DNSSL RA option to userspace Message-ID: <20101212144300.68e0fb16@mjolnir.ossman.eu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org RFC 6106 specifies a new RA option for DNS resolver configuration that therefore needs to end up in userspace. This first patch just exports the new option, but I started thinking that this seems overly complex that the kernel needs to be updated every time there is something new of interest to userspace in the RA. So I also have a second patch that exports everything that the kernel doesn't want. Patches only compile tested so far as I'm still hacking away at userspace. Comments very much welcome though. Rgds Acked-by: Pierre Ynard From a5b60e80eeed87763c811ecfb0d7aa5695d0a2bf Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 12 Dec 2010 00:06:48 +0100 Subject: [PATCH 1/2] ipv6: export DNS search list option to userspace Like DNS resolver addresses, the suffixes to be used in DNS lookups need to be configured by userspace. Make sure userspace has access to the option containing that information. Signed-off-by: Pierre Ossman --- include/net/ndisc.h | 3 ++- net/ipv6/ndisc.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 895997b..9c8698a 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -33,7 +33,8 @@ enum { ND_OPT_MTU = 5, /* RFC2461 */ __ND_OPT_ARRAY_MAX, ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ - ND_OPT_RDNSS = 25, /* RFC5006 */ + ND_OPT_RDNSS = 25, /* RFC5006 / RFC6106 */ + ND_OPT_DNSSL = 31, /* RFC6106 */ __ND_OPT_MAX }; diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 58841c4..c5b01e3 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -233,7 +233,13 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur, static inline int ndisc_is_useropt(struct nd_opt_hdr *opt) { - return (opt->nd_opt_type == ND_OPT_RDNSS); + switch (opt->nd_opt_type) { + case ND_OPT_RDNSS: + case ND_OPT_DNSSL: + return 1; + default: + return 0; + } } static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur, -- 1.7.2.3