diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-11-22 23:03:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 14:22:17 -0500 |
commit | aa285b1740f5b13e5a2606a927f3129954583d78 (patch) | |
tree | 4845acc70e17cbd0c3a16f490aa24e1a00e8eb3c /include/net/xfrm.h | |
parent | 6a632625c7da7594d059b88dae0e9c591af147ba (diff) |
xfrm: fix gre key endianess
fl->fl_gre_key is network byte order contrary to fl->fl_icmp_*.
Make xfrm_flowi_{s|d}port return network byte order values for gre
key too.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 54b283229488..7fa5b005893e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -806,7 +806,7 @@ __be16 xfrm_flowi_sport(struct flowi *fl) | |||
806 | port = htons(fl->fl_mh_type); | 806 | port = htons(fl->fl_mh_type); |
807 | break; | 807 | break; |
808 | case IPPROTO_GRE: | 808 | case IPPROTO_GRE: |
809 | port = htonl(fl->fl_gre_key) >> 16; | 809 | port = htons(ntohl(fl->fl_gre_key) >> 16); |
810 | break; | 810 | break; |
811 | default: | 811 | default: |
812 | port = 0; /*XXX*/ | 812 | port = 0; /*XXX*/ |
@@ -830,7 +830,7 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
830 | port = htons(fl->fl_icmp_code); | 830 | port = htons(fl->fl_icmp_code); |
831 | break; | 831 | break; |
832 | case IPPROTO_GRE: | 832 | case IPPROTO_GRE: |
833 | port = htonl(fl->fl_gre_key) & 0xffff; | 833 | port = htons(ntohl(fl->fl_gre_key) & 0xffff); |
834 | break; | 834 | break; |
835 | default: | 835 | default: |
836 | port = 0; /*XXX*/ | 836 | port = 0; /*XXX*/ |