Skip to contentSkip to conversation

ipv6: unneccessary to get address prefix in addrconf_get_prefix_route

PATCH Applied [email protected] 3 participants 4 messages Dec 23, 2013 – Dec 31, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: unneccessary to get address prefix in addrconf_get_prefix_route

From: Li RongQing <[email protected]>

Since addrconf_get_prefix_route inputs the address prefix to fib6_locate, which does not uses the data which is out of the prefix_len length, so do not need to use ipv6_addr_prefix to get address prefix.

---
 net/ipv6/addrconf.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv6/addrconf.c +1 -4
index 3c3425e..def65f6 100644
@@ -988,12 +988,9 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 	 * --yoshfuji
 	 */
 	if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) {
-		struct in6_addr prefix;
 		struct rt6_info *rt;
 
-		ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
-
-		rt = addrconf_get_prefix_route(&prefix,
+		rt = addrconf_get_prefix_route(&ifp->addr,
 					       ifp->prefix_len,
 					       ifp->idev->dev,
 					       0, RTF_GATEWAY | RTF_DEFAULT);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 11 lines · On Mon, Dec 23, 2013 at 9:32 AM, <[email protected]> wrote:

From: Li RongQing <[email protected]>

Since addrconf_get_prefix_route inputs the address prefix to fib6_locate, which does not uses the data which is out of the prefix_len length, so do not need to use ipv6_addr_prefix to get address prefix.

---
 net/ipv6/addrconf.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

This should be for net-next, sorry.
Thanks

Acked-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On Mon, Dec 23, 2013 at 09:32:38AM +0800, [email protected] wrote:

From: Li RongQing <[email protected]>

Since addrconf_get_prefix_route inputs the address prefix to fib6_locate, which does not uses the data which is out of the prefix_len length, so do not need to use ipv6_addr_prefix to get address prefix.

It was necessary before (a long time ago) but when switching to fib_locate* it became unnecessary.