From: Sven-Thorsten Dietrich <sven@vyatta.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
"nicolas.dichtel@6wind.com" <nicolas.dichtel@6wind.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Mike Davison <Mike.Davison@vyatta.com>
Subject: [PATCH] Set the correct RTNL family for multicast netconf messages
Date: Thu, 27 Jun 2013 16:44:47 -0700 [thread overview]
Message-ID: <1372376687.21767.10.camel@imac-linux.luckyscavenger.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1647 bytes --]
There may be other cases that require a special case, so I chose the switch approach.
Please note, that all other messages from ipmr[6].c correctly set the family, while these do not.
Thanks
Sven
Subject: Set correct RTNL family for multicast netconf messages
From: Sven-Thorsten Dietrich sven@vyatta.com Thu Jun 27 16:40:17 2013 -0700
Date: Thu Jun 27 16:40:17 2013 -0700:
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index dfc39d4..695858b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1705,7 +1705,16 @@ static int inet_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
return -EMSGSIZE;
ncm = nlmsg_data(nlh);
- ncm->ncm_family = AF_INET;
+
+ switch (type) {
+ case NETCONFA_MC_FORWARDING:
+ ncm->ncm_family = RTNL_FAMILY_IPMR;
+ break;
+
+ default:
+ ncm->ncm_family = AF_INET;
+ break;
+ }
if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
goto nla_put_failure;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4ab4c38..a177da4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -492,7 +492,16 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
return -EMSGSIZE;
ncm = nlmsg_data(nlh);
- ncm->ncm_family = AF_INET6;
+
+ switch (type) {
+ case NETCONFA_MC_FORWARDING:
+ ncm->ncm_family = RTNL_FAMILY_IP6MR;
+ break;
+
+ default:
+ ncm->ncm_family = AF_INET6;
+ break;
+ }
if (nla_put_s32(skb, NETCONFA_IFINDEX, ifindex) < 0)
goto nla_put_failure;
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next reply other threads:[~2013-06-27 23:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 23:44 Sven-Thorsten Dietrich [this message]
2013-06-28 1:23 ` Hannes Frederic Sowa
2013-06-28 1:33 ` Stephen Hemminger
2013-06-28 1:51 ` Hannes Frederic Sowa
2013-06-28 10:13 ` Nicolas Dichtel
2013-06-28 15:26 ` Stephen Hemminger
2013-06-28 15:54 ` Nicolas Dichtel
2013-06-28 16:13 ` [RFC net] netconf: set mulitcast family for multicast forwarding messages Stephen Hemminger
2013-07-01 12:38 ` Nicolas Dichtel
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=1372376687.21767.10.camel@imac-linux.luckyscavenger.com \
--to=sven@vyatta.com \
--cc=Mike.Davison@vyatta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=shemminger@vyatta.com \
/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
Powered by JetHome