Message ID | 4CEBC9C1.8080101@iki.fi |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Timo Teräs <timo.teras@iki.fi> Date: Tue, 23 Nov 2010 16:03:45 +0200 > So we probably would need to do: > > 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> Ok, applied, thanks Timo. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 1a57ff9..916ac47 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -806,7 +806,7 @@ __be16 xfrm_flowi_sport(struct flowi *fl) port = htons(fl->fl_mh_type); break; case IPPROTO_GRE: - port = htonl(fl->fl_gre_key) >> 16; + port = htons(ntohl(fl->fl_gre_key) >> 16); break; default: port = 0; /*XXX*/ @@ -830,7 +830,7 @@ __be16 xfrm_flowi_dport(struct flowi *fl) port = htons(fl->fl_icmp_code); break; case IPPROTO_GRE: - port = htonl(fl->fl_gre_key) & 0xffff; + port = htons(ntohl(fl->fl_gre_key) & 0xffff); break; default: port = 0; /*XXX*/