--- zzzz-none-000/linux-4.1.52/include/net/ipv6.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/net/ipv6.h 2022-03-02 11:37:13.000000000 +0000 @@ -310,11 +310,22 @@ static inline bool ipv6_accept_ra(struct inet6_dev *idev) { +#if defined(CONFIG_BCM_KF_IP) + /* WAN interface needs to act like a host. */ + if (((idev->cnf.forwarding) && + (!(idev->dev->priv_flags & IFF_WANDEV) || + ((idev->dev->priv_flags & IFF_WANDEV) && + netdev_path_is_root(idev->dev)))) + && (idev->cnf.accept_ra < 2)) + return 0; + return idev->cnf.accept_ra; +#else /* If forwarding is enabled, RA are not accepted unless the special * hybrid mode (accept_ra=2) is enabled. */ return idev->cnf.forwarding ? idev->cnf.accept_ra == 2 : idev->cnf.accept_ra; +#endif } #if IS_ENABLED(CONFIG_IPV6) @@ -891,6 +902,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); +int __ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, + int addr_len); int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr, int addr_len);