lkml.org 
[lkml]   [2013]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Set the correct RTNL family for multicast netconf messages
On Thu, Jun 27, 2013 at 04:44:47PM -0700, Sven-Thorsten Dietrich wrote:
> 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;
> + }
>

Hm, are you sure? NETCONFA_MC_FORWARDING is of type RTM_NEWNETCONF
and expects ncm_family to be either AF_INET or AF_INET6 (at least in
iproute2/ipmonitor.c).

Greetings,

Hannes



\
 
 \ /
  Last update: 2013-06-28 03:41    [W:0.334 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site