aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 717584bad02e..8499da9e76a2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -40,6 +40,7 @@
40 40
41#include <linux/errno.h> 41#include <linux/errno.h>
42#include <linux/types.h> 42#include <linux/types.h>
43#include <linux/kernel.h>
43#include <linux/socket.h> 44#include <linux/socket.h>
44#include <linux/sockios.h> 45#include <linux/sockios.h>
45#include <linux/net.h> 46#include <linux/net.h>
@@ -1215,16 +1216,12 @@ int ipv6_dev_get_saddr(struct net *net, struct net_device *dst_dev,
1215 } 1216 }
1216 break; 1217 break;
1217 } else if (minihiscore < miniscore) { 1218 } else if (minihiscore < miniscore) {
1218 struct ipv6_saddr_score *tmp;
1219
1220 if (hiscore->ifa) 1219 if (hiscore->ifa)
1221 in6_ifa_put(hiscore->ifa); 1220 in6_ifa_put(hiscore->ifa);
1222 1221
1223 in6_ifa_hold(score->ifa); 1222 in6_ifa_hold(score->ifa);
1224 1223
1225 tmp = hiscore; 1224 swap(hiscore, score);
1226 hiscore = score;
1227 score = tmp;
1228 1225
1229 /* restore our iterator */ 1226 /* restore our iterator */
1230 score->ifa = hiscore->ifa; 1227 score->ifa = hiscore->ifa;