aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
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 /include/net/xfrm.h
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 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index d5a12d10a0d4..aa860add570b 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -800,7 +800,7 @@ static inline bool addr_match(const void *token1, const void *token2,
800} 800}
801 801
802static __inline__ 802static __inline__
803__be16 xfrm_flowi_sport(const struct flowi *fl) 803__be16 xfrm_flowi_sport(const struct flowi *fl, const union flowi_uli *uli)
804{ 804{
805 __be16 port; 805 __be16 port;
806 switch(fl->flowi_proto) { 806 switch(fl->flowi_proto) {
@@ -808,17 +808,17 @@ __be16 xfrm_flowi_sport(const struct flowi *fl)
808 case IPPROTO_UDP: 808 case IPPROTO_UDP:
809 case IPPROTO_UDPLITE: 809 case IPPROTO_UDPLITE:
810 case IPPROTO_SCTP: 810 case IPPROTO_SCTP:
811 port = fl->fl_ip_sport; 811 port = uli->ports.sport;
812 break; 812 break;
813 case IPPROTO_ICMP: 813 case IPPROTO_ICMP:
814 case IPPROTO_ICMPV6: 814 case IPPROTO_ICMPV6:
815 port = htons(fl->fl_icmp_type); 815 port = htons(uli->icmpt.type);
816 break; 816 break;
817 case IPPROTO_MH: 817 case IPPROTO_MH:
818 port = htons(fl->fl_mh_type); 818 port = htons(uli->mht.type);
819 break; 819 break;
820 case IPPROTO_GRE: 820 case IPPROTO_GRE:
821 port = htons(ntohl(fl->fl_gre_key) >> 16); 821 port = htons(ntohl(uli->gre_key) >> 16);
822 break; 822 break;
823 default: 823 default:
824 port = 0; /*XXX*/ 824 port = 0; /*XXX*/
@@ -827,7 +827,7 @@ __be16 xfrm_flowi_sport(const struct flowi *fl)
827} 827}
828 828
829static __inline__ 829static __inline__
830__be16 xfrm_flowi_dport(const struct flowi *fl) 830__be16 xfrm_flowi_dport(const struct flowi *fl, const union flowi_uli *uli)
831{ 831{
832 __be16 port; 832 __be16 port;
833 switch(fl->flowi_proto) { 833 switch(fl->flowi_proto) {
@@ -835,14 +835,14 @@ __be16 xfrm_flowi_dport(const struct flowi *fl)
835 case IPPROTO_UDP: 835 case IPPROTO_UDP:
836 case IPPROTO_UDPLITE: 836 case IPPROTO_UDPLITE:
837 case IPPROTO_SCTP: 837 case IPPROTO_SCTP:
838 port = fl->fl_ip_dport; 838 port = uli->ports.dport;
839 break; 839 break;
840 case IPPROTO_ICMP: 840 case IPPROTO_ICMP:
841 case IPPROTO_ICMPV6: 841 case IPPROTO_ICMPV6:
842 port = htons(fl->fl_icmp_code); 842 port = htons(uli->icmpt.code);
843 break; 843 break;
844 case IPPROTO_GRE: 844 case IPPROTO_GRE:
845 port = htons(ntohl(fl->fl_gre_key) & 0xffff); 845 port = htons(ntohl(uli->gre_key) & 0xffff);
846 break; 846 break;
847 default: 847 default:
848 port = 0; /*XXX*/ 848 port = 0; /*XXX*/