@@ -4821,7 +4821,7 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh,
48214821 ifm -> ifa_prefixlen , extack );
48224822}
48234823
4824- static int modify_prefix_route (struct inet6_ifaddr * ifp ,
4824+ static int modify_prefix_route (struct net * net , struct inet6_ifaddr * ifp ,
48254825 unsigned long expires , u32 flags ,
48264826 bool modify_peer )
48274827{
@@ -4845,7 +4845,9 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp,
48454845 ifp -> prefix_len ,
48464846 ifp -> rt_priority , ifp -> idev -> dev ,
48474847 expires , flags , GFP_KERNEL );
4848- } else {
4848+ return 0 ;
4849+ }
4850+ if (f6i != net -> ipv6 .fib6_null_entry ) {
48494851 table = f6i -> fib6_table ;
48504852 spin_lock_bh (& table -> tb6_lock );
48514853
@@ -4858,9 +4860,8 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp,
48584860 }
48594861
48604862 spin_unlock_bh (& table -> tb6_lock );
4861-
4862- fib6_info_release (f6i );
48634863 }
4864+ fib6_info_release (f6i );
48644865
48654866 return 0 ;
48664867}
@@ -4939,7 +4940,7 @@ static int inet6_addr_modify(struct net *net, struct inet6_ifaddr *ifp,
49394940 int rc = - ENOENT ;
49404941
49414942 if (had_prefixroute )
4942- rc = modify_prefix_route (ifp , expires , flags , false);
4943+ rc = modify_prefix_route (net , ifp , expires , flags , false);
49434944
49444945 /* prefix route could have been deleted; if so restore it */
49454946 if (rc == - ENOENT ) {
@@ -4949,7 +4950,7 @@ static int inet6_addr_modify(struct net *net, struct inet6_ifaddr *ifp,
49494950 }
49504951
49514952 if (had_prefixroute && !ipv6_addr_any (& ifp -> peer_addr ))
4952- rc = modify_prefix_route (ifp , expires , flags , true);
4953+ rc = modify_prefix_route (net , ifp , expires , flags , true);
49534954
49544955 if (rc == - ENOENT && !ipv6_addr_any (& ifp -> peer_addr )) {
49554956 addrconf_prefix_route (& ifp -> peer_addr , ifp -> prefix_len ,
0 commit comments