Skip to content

Commit 83eadda

Browse files
congwangdavem330
authored andcommitted
ipv6/dccp: do not inherit ipv6_mc_list from parent
Like commit 657831f ("dccp/tcp: do not inherit mc_list from parent") we should clear ipv6_mc_list etc. for IPv6 sockets too. Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0fe20fa commit 83eadda

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

net/dccp/ipv6.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk,
426426
newsk->sk_backlog_rcv = dccp_v4_do_rcv;
427427
newnp->pktoptions = NULL;
428428
newnp->opt = NULL;
429+
newnp->ipv6_mc_list = NULL;
430+
newnp->ipv6_ac_list = NULL;
431+
newnp->ipv6_fl_list = NULL;
429432
newnp->mcast_oif = inet6_iif(skb);
430433
newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
431434

@@ -490,6 +493,9 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk,
490493
/* Clone RX bits */
491494
newnp->rxopt.all = np->rxopt.all;
492495

496+
newnp->ipv6_mc_list = NULL;
497+
newnp->ipv6_ac_list = NULL;
498+
newnp->ipv6_fl_list = NULL;
493499
newnp->pktoptions = NULL;
494500
newnp->opt = NULL;
495501
newnp->mcast_oif = inet6_iif(skb);

net/ipv6/tcp_ipv6.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
10621062
newtp->af_specific = &tcp_sock_ipv6_mapped_specific;
10631063
#endif
10641064

1065+
newnp->ipv6_mc_list = NULL;
10651066
newnp->ipv6_ac_list = NULL;
10661067
newnp->ipv6_fl_list = NULL;
10671068
newnp->pktoptions = NULL;
@@ -1131,6 +1132,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
11311132
First: no IPv4 options.
11321133
*/
11331134
newinet->inet_opt = NULL;
1135+
newnp->ipv6_mc_list = NULL;
11341136
newnp->ipv6_ac_list = NULL;
11351137
newnp->ipv6_fl_list = NULL;
11361138

0 commit comments

Comments
 (0)