--- zzzz-none-000/linux-4.19.183/net/ipv6/addrconf.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/net/ipv6/addrconf.c 2023-06-28 08:54:21.000000000 +0000 @@ -142,7 +142,9 @@ static void ipv6_regen_rndid(struct inet6_dev *idev); static void ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr); +#if !defined(CONFIG_BCM_KF_IPV6) static int ipv6_generate_eui64(u8 *eui, struct net_device *dev); +#endif static int ipv6_count_addresses(const struct inet6_dev *idev); static int ipv6_generate_stable_address(struct in6_addr *addr, u8 dad_count, @@ -223,7 +225,11 @@ .proxy_ndp = 0, .accept_source_route = 0, /* we do not accept RH0 by default. */ .disable_ipv6 = 0, +#if defined(CONFIG_BCM_KF_IPV6) + .accept_dad = 2, +#else .accept_dad = 0, +#endif .suppress_frag_ndisc = 1, .accept_ra_mtu = 1, .stable_secret = { @@ -277,7 +283,11 @@ .proxy_ndp = 0, .accept_source_route = 0, /* we do not accept RH0 by default. */ .disable_ipv6 = 0, +#if defined(CONFIG_BCM_KF_IPV6) + .accept_dad = 2, +#else .accept_dad = 1, +#endif .suppress_frag_ndisc = 1, .accept_ra_mtu = 1, .stable_secret = { @@ -386,6 +396,18 @@ if (ndev->cnf.stable_secret.initialized) ndev->cnf.addr_gen_mode = IN6_ADDR_GEN_MODE_STABLE_PRIVACY; +#if defined(CONFIG_BCM_KF_IPV6) + /* + * At bootup time, there is no interfaces attached to brX. Therefore, DAD of + * brX cannot take any effect and we cannot pass IPv6 ReadyLogo. We here + * increase DAD period of brX to 4 sec which should be long enough for our + * system to attach all interfaces to brX. Thus, DAD of brX can send/receive + * packets through attached interfaces. + */ + if (dev->priv_flags & IFF_EBRIDGE) + ndev->cnf.dad_transmits = 4; +#endif + ndev->cnf.mtu6 = dev->mtu; ndev->nd_parms = neigh_parms_alloc(dev, &nd_tbl); if (!ndev->nd_parms) { @@ -917,6 +939,9 @@ kfree_rcu(ifp, rcu); } +#if defined(CONFIG_BCM_KF_MPTCP) && defined(CONFIG_BCM_MPTCP) +EXPORT_SYMBOL(inet6_ifa_finish_destroy); +#endif static void ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) @@ -1198,7 +1223,11 @@ /* This function wants to get referenced ifp and releases it before return */ +#if defined(CONFIG_BCM_KF_IPV6) +void ipv6_del_addr(struct inet6_ifaddr *ifp) +#else static void ipv6_del_addr(struct inet6_ifaddr *ifp) +#endif { int state; enum cleanup_prefix_rt_t action = CLEANUP_PREFIX_RT_NOP; @@ -2231,7 +2260,11 @@ return 0; } +#if defined(CONFIG_BCM_KF_IPV6) +int ipv6_generate_eui64(u8 *eui, struct net_device *dev) +#else static int ipv6_generate_eui64(u8 *eui, struct net_device *dev) +#endif { switch (dev->type) { case ARPHRD_ETHER: @@ -3604,6 +3637,12 @@ } break; +#if defined(CONFIG_BCM_KF_IPV6) + case NETDEV_CHANGEADDR: + addrconf_update_lladdr(dev); + break; +#endif + case NETDEV_PRE_TYPE_CHANGE: case NETDEV_POST_TYPE_CHANGE: if (idev) @@ -3657,6 +3696,7 @@ struct inet6_dev *idev; struct inet6_ifaddr *ifa, *tmp; bool keep_addr = false; + bool was_ready; int state, i; ASSERT_RTNL(); @@ -3722,7 +3762,10 @@ addrconf_del_rs_timer(idev); - /* Step 2: clear flags for stateless addrconf */ + /* Step 2: clear flags for stateless addrconf, repeated down + * detection + */ + was_ready = idev->if_flags & IF_READY; if (!how) idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); @@ -3796,7 +3839,7 @@ if (how) { ipv6_ac_destroy_dev(idev); ipv6_mc_destroy_dev(idev); - } else { + } else if (was_ready) { ipv6_mc_down(idev); }