Commit d59eb177 authored by Al Viro's avatar Al Viro

ip6_mc_msfilter(): pass the address list separately

that way we'll be able to reuse it for compat case
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2e041728
...@@ -1136,7 +1136,8 @@ struct group_filter; ...@@ -1136,7 +1136,8 @@ struct group_filter;
int ip6_mc_source(int add, int omode, struct sock *sk, int ip6_mc_source(int add, int omode, struct sock *sk,
struct group_source_req *pgsr); struct group_source_req *pgsr);
int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf); int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf,
struct sockaddr_storage *list);
int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
struct sockaddr_storage __user *p); struct sockaddr_storage __user *p);
......
...@@ -780,7 +780,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, ...@@ -780,7 +780,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
retv = -EINVAL; retv = -EINVAL;
break; break;
} }
retv = ip6_mc_msfilter(sk, gsf); retv = ip6_mc_msfilter(sk, gsf, gsf->gf_slist);
kfree(gsf); kfree(gsf);
break; break;
......
...@@ -457,7 +457,8 @@ int ip6_mc_source(int add, int omode, struct sock *sk, ...@@ -457,7 +457,8 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
return err; return err;
} }
int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf,
struct sockaddr_storage *list)
{ {
const struct in6_addr *group; const struct in6_addr *group;
struct ipv6_mc_socklist *pmc; struct ipv6_mc_socklist *pmc;
...@@ -509,10 +510,10 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) ...@@ -509,10 +510,10 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
goto done; goto done;
} }
newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc; newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc;
for (i = 0; i < newpsl->sl_count; ++i) { for (i = 0; i < newpsl->sl_count; ++i, ++list) {
struct sockaddr_in6 *psin6; struct sockaddr_in6 *psin6;
psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i]; psin6 = (struct sockaddr_in6 *)list;
newpsl->sl_addr[i] = psin6->sin6_addr; newpsl->sl_addr[i] = psin6->sin6_addr;
} }
err = ip6_mc_add_src(idev, group, gsf->gf_fmode, err = ip6_mc_add_src(idev, group, gsf->gf_fmode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment