diff options
author | Patrick McHardy <kaber@trash.net> | 2006-09-20 15:08:03 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:20:08 -0400 |
commit | 955b944293dd4c931ec866ebe19a6b2463b8f9a0 (patch) | |
tree | 2b3053116a8585810977383c3d28c60c0f7d0fb5 /include | |
parent | edd5a329cf69c112882e03c8ab55e985062a5d2a (diff) |
[NETFILTER]: PPTP conntrack: get rid of unnecessary byte order conversions
The conntrack structure contains the call ID in host byte order for no
reason, get rid of back and forth conversions.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_pptp.h | 8 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h | 22 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_nat_pptp.h | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h index 88f66d3c8765..0d35623f9453 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h | |||
@@ -31,8 +31,8 @@ struct ip_ct_pptp_master { | |||
31 | /* everything below is going to be per-expectation in newnat, | 31 | /* everything below is going to be per-expectation in newnat, |
32 | * since there could be more than one call within one session */ | 32 | * since there could be more than one call within one session */ |
33 | enum pptp_ctrlcall_state cstate; /* call state */ | 33 | enum pptp_ctrlcall_state cstate; /* call state */ |
34 | u_int16_t pac_call_id; /* call id of PAC, host byte order */ | 34 | __be16 pac_call_id; /* call id of PAC, host byte order */ |
35 | u_int16_t pns_call_id; /* call id of PNS, host byte order */ | 35 | __be16 pns_call_id; /* call id of PNS, host byte order */ |
36 | 36 | ||
37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack | 37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack |
38 | * and therefore imposes a fixed limit on the number of maps */ | 38 | * and therefore imposes a fixed limit on the number of maps */ |
@@ -42,8 +42,8 @@ struct ip_ct_pptp_master { | |||
42 | /* conntrack_expect private member */ | 42 | /* conntrack_expect private member */ |
43 | struct ip_ct_pptp_expect { | 43 | struct ip_ct_pptp_expect { |
44 | enum pptp_ctrlcall_state cstate; /* call state */ | 44 | enum pptp_ctrlcall_state cstate; /* call state */ |
45 | u_int16_t pac_call_id; /* call id of PAC */ | 45 | __be16 pac_call_id; /* call id of PAC */ |
46 | u_int16_t pns_call_id; /* call id of PNS */ | 46 | __be16 pns_call_id; /* call id of PNS */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | 49 | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h index 8d090ef82f5f..1d853aa873eb 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h | |||
@@ -49,18 +49,18 @@ struct gre_hdr { | |||
49 | #else | 49 | #else |
50 | #error "Adjust your <asm/byteorder.h> defines" | 50 | #error "Adjust your <asm/byteorder.h> defines" |
51 | #endif | 51 | #endif |
52 | __u16 protocol; | 52 | __be16 protocol; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* modified GRE header for PPTP */ | 55 | /* modified GRE header for PPTP */ |
56 | struct gre_hdr_pptp { | 56 | struct gre_hdr_pptp { |
57 | __u8 flags; /* bitfield */ | 57 | __u8 flags; /* bitfield */ |
58 | __u8 version; /* should be GRE_VERSION_PPTP */ | 58 | __u8 version; /* should be GRE_VERSION_PPTP */ |
59 | __u16 protocol; /* should be GRE_PROTOCOL_PPTP */ | 59 | __be16 protocol; /* should be GRE_PROTOCOL_PPTP */ |
60 | __u16 payload_len; /* size of ppp payload, not inc. gre header */ | 60 | __be16 payload_len; /* size of ppp payload, not inc. gre header */ |
61 | __u16 call_id; /* peer's call_id for this session */ | 61 | __be16 call_id; /* peer's call_id for this session */ |
62 | __u32 seq; /* sequence number. Present if S==1 */ | 62 | __be32 seq; /* sequence number. Present if S==1 */ |
63 | __u32 ack; /* seq number of highest packet recieved by */ | 63 | __be32 ack; /* seq number of highest packet recieved by */ |
64 | /* sender in this session */ | 64 | /* sender in this session */ |
65 | }; | 65 | }; |
66 | 66 | ||
@@ -92,13 +92,13 @@ void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct); | |||
92 | 92 | ||
93 | 93 | ||
94 | /* get pointer to gre key, if present */ | 94 | /* get pointer to gre key, if present */ |
95 | static inline u_int32_t *gre_key(struct gre_hdr *greh) | 95 | static inline __be32 *gre_key(struct gre_hdr *greh) |
96 | { | 96 | { |
97 | if (!greh->key) | 97 | if (!greh->key) |
98 | return NULL; | 98 | return NULL; |
99 | if (greh->csum || greh->routing) | 99 | if (greh->csum || greh->routing) |
100 | return (u_int32_t *) (greh+sizeof(*greh)+4); | 100 | return (__be32 *) (greh+sizeof(*greh)+4); |
101 | return (u_int32_t *) (greh+sizeof(*greh)); | 101 | return (__be32 *) (greh+sizeof(*greh)); |
102 | } | 102 | } |
103 | 103 | ||
104 | /* get pointer ot gre csum, if present */ | 104 | /* get pointer ot gre csum, if present */ |
diff --git a/include/linux/netfilter_ipv4/ip_nat_pptp.h b/include/linux/netfilter_ipv4/ip_nat_pptp.h index eaf66c2e8f93..36668bf0f373 100644 --- a/include/linux/netfilter_ipv4/ip_nat_pptp.h +++ b/include/linux/netfilter_ipv4/ip_nat_pptp.h | |||
@@ -4,8 +4,8 @@ | |||
4 | 4 | ||
5 | /* conntrack private data */ | 5 | /* conntrack private data */ |
6 | struct ip_nat_pptp { | 6 | struct ip_nat_pptp { |
7 | u_int16_t pns_call_id; /* NAT'ed PNS call id */ | 7 | __be16 pns_call_id; /* NAT'ed PNS call id */ |
8 | u_int16_t pac_call_id; /* NAT'ed PAC call id */ | 8 | __be16 pac_call_id; /* NAT'ed PAC call id */ |
9 | }; | 9 | }; |
10 | 10 | ||
11 | #endif /* _NAT_PPTP_H */ | 11 | #endif /* _NAT_PPTP_H */ |