Merge tag 'v3.10.76' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv6 / ndisc.c
index 05f361338c2eabd0d27449cd8d85a3c29e19046d..42c40b119c8995e47366722db891b679e9d2c50f 100644 (file)
@@ -1332,12 +1332,35 @@ skip_routeinfo:
                }
        }
 
+#ifdef CONFIG_MTK_DHCPV6C_WIFI
+       if (in6_dev->if_flags & IF_RA_OTHERCONF){
+               printk(KERN_INFO "[mtk_net][ipv6]receive RA with o bit!\n");
+               in6_dev->cnf.ra_info_flag = 1;
+       } 
+       if(in6_dev->if_flags & IF_RA_MANAGED){
+               printk(KERN_INFO "[mtk_net][ipv6]receive RA with m bit!\n");
+               in6_dev->cnf.ra_info_flag = 2;
+       }
+       if(in6_dev->cnf.ra_info_flag == 0){
+               printk(KERN_INFO "[mtk_net][ipv6]receive RA neither O nor M bit is set!\n");
+               in6_dev->cnf.ra_info_flag = 4;
+       }
+#endif
+
        if (ndopts.nd_useropts) {
                struct nd_opt_hdr *p;
                for (p = ndopts.nd_useropts;
                     p;
                     p = ndisc_next_useropt(p, ndopts.nd_useropts_end)) {
                        ndisc_ra_useropt(skb, p);
+#ifdef CONFIG_MTK_DHCPV6C_WIFI
+                       /* only clear ra_info_flag when O bit is set */
+                       if (p->nd_opt_type == ND_OPT_RDNSS &&
+                                       in6_dev->if_flags & IF_RA_OTHERCONF) {
+                               printk(KERN_INFO "[mtk_net][ipv6]RDNSS, ignore RA with o bit!\n");
+                               in6_dev->cnf.ra_info_flag = 0;
+                       } 
+#endif
                }
        }
 
@@ -1549,7 +1572,7 @@ int ndisc_rcv(struct sk_buff *skb)
        }
 
        memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
-
+       
        switch (msg->icmph.icmp6_type) {
        case NDISC_NEIGHBOUR_SOLICITATION:
                ndisc_recv_ns(skb);