Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78117
b: refs/heads/master
c: 303065a
h: refs/heads/master
i:
  78115: 55bf34f
v: v3
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Jan 28, 2008
1 parent 34ce555 commit 232d189
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1ee656ccb3b03304d38f852debccdd1567702e6
refs/heads/master: 303065a8545bf7524550bd9564afb48e8a685a2d
12 changes: 8 additions & 4 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ static inline int ipv6_saddr_preferred(int type)
}

/* static matching label */
static inline int ipv6_addr_label(const struct in6_addr *addr, int type)
static inline int ipv6_addr_label(const struct in6_addr *addr, int type,
int ifindex)
{
/*
* prefix (longest match) label
Expand Down Expand Up @@ -910,7 +911,8 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
struct inet6_ifaddr *ifa_result = NULL;
int daddr_type = __ipv6_addr_type(daddr);
int daddr_scope = __ipv6_addr_src_scope(daddr_type);
u32 daddr_label = ipv6_addr_label(daddr, daddr_type);
int daddr_ifindex = daddr_dev ? daddr_dev->ifindex : 0;
u32 daddr_label = ipv6_addr_label(daddr, daddr_type, daddr_ifindex);
struct net_device *dev;

memset(&hiscore, 0, sizeof(hiscore));
Expand Down Expand Up @@ -1084,12 +1086,14 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
/* Rule 6: Prefer matching label */
if (hiscore.rule < 6) {
if (ipv6_addr_label(&ifa_result->addr,
hiscore.addr_type) == daddr_label)
hiscore.addr_type,
ifa_result->idev->dev->ifindex) == daddr_label)
hiscore.attrs |= IPV6_SADDR_SCORE_LABEL;
hiscore.rule++;
}
if (ipv6_addr_label(&ifa->addr,
score.addr_type) == daddr_label) {
score.addr_type,
ifa->idev->dev->ifindex) == daddr_label) {
score.attrs |= IPV6_SADDR_SCORE_LABEL;
if (!(hiscore.attrs & IPV6_SADDR_SCORE_LABEL)) {
score.rule = 6;
Expand Down

0 comments on commit 232d189

Please sign in to comment.