netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: enh@google.com
Cc: brian.haley@hp.com, netdev@vger.kernel.org
Subject: Re: linux kernel's IPV6_MULTICAST_HOPS default is 64; should be 1?
Date: Mon, 03 May 2010 23:42:54 -0700 (PDT)	[thread overview]
Message-ID: <20100503.234254.150142339.davem@davemloft.net> (raw)
In-Reply-To: <AANLkTimf-FWCsiLqYDGg4nl-relRMuNvDowfTKZbe9kx@mail.gmail.com>

From: enh <enh@google.com>
Date: Mon, 3 May 2010 23:27:23 -0700

> On Mon, May 3, 2010 at 23:22, David Miller <davem@davemloft.net> wrote:
>> Ok, I see, so yeah this needs to be fixed to use "1" instead of
>> "-1" in the np->xxx ipv6 socket initialization.
> 
> i think so. there's already the IPV6_DEFAULT_MCASTHOPS constant
> defined to 1 but unused according to gitweb, so you might want to
> either use it or remove it.

I've applied the following, thanks Elliot.

--------------------
ipv6: Fix default multicast hops setting.

As per RFC 3493 the default multicast hops setting
for a socket should be "1" just like ipv4.

Ironically we have a IPV6_DEFAULT_MCASTHOPS macro
it just wasn't being used.

Reported-by: Elliot Hughes <enh@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv6/af_inet6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 3192aa0..3f9e86b 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -200,7 +200,7 @@ lookup_protocol:
 
 	inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk);
 	np->hop_limit	= -1;
-	np->mcast_hops	= -1;
+	np->mcast_hops	= IPV6_DEFAULT_MCASTHOPS;
 	np->mc_loop	= 1;
 	np->pmtudisc	= IPV6_PMTUDISC_WANT;
 	np->ipv6only	= net->ipv6.sysctl.bindv6only;
-- 
1.7.0.4


  reply	other threads:[~2010-05-04  6:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04  1:33 linux kernel's IPV6_MULTICAST_HOPS default is 64; should be 1? enh
2010-05-04  2:16 ` Brian Haley
2010-05-04  3:58   ` enh
2010-05-04  6:05   ` David Miller
2010-05-04  6:19     ` enh
2010-05-04  6:22       ` David Miller
2010-05-04  6:27         ` enh
2010-05-04  6:42           ` David Miller [this message]
2010-05-04  7:48           ` David Stevens
2010-05-04  7:57             ` David Miller
2010-05-04 14:40               ` Brian Haley
2010-05-04 16:12                 ` David Stevens
2010-05-04 16:43                   ` Brian Haley
2010-05-04 17:05                     ` David Stevens
2010-05-04 21:39                   ` David Miller
2010-05-04 21:38                 ` David Miller
2010-05-04 21:46                 ` David Miller
2010-05-04 22:26                   ` enh
2010-05-04 23:07                     ` David Miller
2010-05-05 15:36                   ` Brian Haley
2010-05-05 22:00                     ` David Miller
2010-05-06  1:50                       ` Brian Haley
2010-05-06  7:10                         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100503.234254.150142339.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=brian.haley@hp.com \
    --cc=enh@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).