aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 00:43:55 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:46 -0500
commit6281dcc94a96bd73017b2baa8fa83925405109ef (patch)
tree8deee4d66d256d10ea25f66520eb96b1fade1545 /net/xfrm
parent08704bcbf022786532b5f188935ab6619906049f (diff)
net: Make flowi ports AF dependent.
Create two sets of port member accessors, one set prefixed by fl4_* and the other prefixed by fl6_* This will let us to create AF optimal flow instances. It will work because every context in which we access the ports, we have to be fully aware of which AF the flowi is anyways. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_policy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index dd6243f9d933..d54b6e7165c6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -61,8 +61,8 @@ __xfrm4_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
61{ 61{
62 return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) && 62 return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) &&
63 addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) && 63 addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) &&
64 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && 64 !((xfrm_flowi_dport(fl, &fl->uli_u) ^ sel->dport) & sel->dport_mask) &&
65 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 65 !((xfrm_flowi_sport(fl, &fl->uli_u) ^ sel->sport) & sel->sport_mask) &&
66 (fl->flowi_proto == sel->proto || !sel->proto) && 66 (fl->flowi_proto == sel->proto || !sel->proto) &&
67 (fl->flowi_oif == sel->ifindex || !sel->ifindex); 67 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
68} 68}
@@ -72,8 +72,8 @@ __xfrm6_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
72{ 72{
73 return addr_match(&fl->fl6_dst, &sel->daddr, sel->prefixlen_d) && 73 return addr_match(&fl->fl6_dst, &sel->daddr, sel->prefixlen_d) &&
74 addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) && 74 addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) &&
75 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && 75 !((xfrm_flowi_dport(fl, &fl->uli_u) ^ sel->dport) & sel->dport_mask) &&
76 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 76 !((xfrm_flowi_sport(fl, &fl->uli_u) ^ sel->sport) & sel->sport_mask) &&
77 (fl->flowi_proto == sel->proto || !sel->proto) && 77 (fl->flowi_proto == sel->proto || !sel->proto) &&
78 (fl->flowi_oif == sel->ifindex || !sel->ifindex); 78 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
79} 79}