diff options
-rw-r--r-- | net/ipv4/netfilter/nf_nat_proto_dccp.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_proto_gre.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_sctp.c | 17 |
3 files changed, 13 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/nf_nat_proto_dccp.c b/net/ipv4/netfilter/nf_nat_proto_dccp.c index f78eb26e9a20..22485ce306d4 100644 --- a/net/ipv4/netfilter/nf_nat_proto_dccp.c +++ b/net/ipv4/netfilter/nf_nat_proto_dccp.c | |||
@@ -38,7 +38,7 @@ dccp_manip_pkt(struct sk_buff *skb, | |||
38 | const struct nf_conntrack_tuple *tuple, | 38 | const struct nf_conntrack_tuple *tuple, |
39 | enum nf_nat_manip_type maniptype) | 39 | enum nf_nat_manip_type maniptype) |
40 | { | 40 | { |
41 | struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); | 41 | const struct iphdr *iph = (const void *)(skb->data + iphdroff); |
42 | struct dccp_hdr *hdr; | 42 | struct dccp_hdr *hdr; |
43 | unsigned int hdroff = iphdroff + iph->ihl * 4; | 43 | unsigned int hdroff = iphdroff + iph->ihl * 4; |
44 | __be32 oldip, newip; | 44 | __be32 oldip, newip; |
diff --git a/net/ipv4/netfilter/nf_nat_proto_gre.c b/net/ipv4/netfilter/nf_nat_proto_gre.c index 4c4af5a6d6c8..d7e89201351e 100644 --- a/net/ipv4/netfilter/nf_nat_proto_gre.c +++ b/net/ipv4/netfilter/nf_nat_proto_gre.c | |||
@@ -84,7 +84,7 @@ gre_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, | |||
84 | const struct nf_conntrack_tuple *tuple, | 84 | const struct nf_conntrack_tuple *tuple, |
85 | enum nf_nat_manip_type maniptype) | 85 | enum nf_nat_manip_type maniptype) |
86 | { | 86 | { |
87 | struct gre_hdr *greh; | 87 | const struct gre_hdr *greh; |
88 | struct gre_hdr_pptp *pgreh; | 88 | struct gre_hdr_pptp *pgreh; |
89 | const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); | 89 | const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); |
90 | unsigned int hdroff = iphdroff + iph->ihl * 4; | 90 | unsigned int hdroff = iphdroff + iph->ihl * 4; |
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 2d47351f70dc..cbf2e27a22b2 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
@@ -33,7 +33,7 @@ static DEFINE_RWLOCK(sctp_lock); | |||
33 | 33 | ||
34 | And so for me for SCTP :D -Kiran */ | 34 | And so for me for SCTP :D -Kiran */ |
35 | 35 | ||
36 | static const char *sctp_conntrack_names[] = { | 36 | static const char *const sctp_conntrack_names[] = { |
37 | "NONE", | 37 | "NONE", |
38 | "CLOSED", | 38 | "CLOSED", |
39 | "COOKIE_WAIT", | 39 | "COOKIE_WAIT", |
@@ -133,7 +133,8 @@ static const u8 sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { | |||
133 | static bool sctp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, | 133 | static bool sctp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, |
134 | struct nf_conntrack_tuple *tuple) | 134 | struct nf_conntrack_tuple *tuple) |
135 | { | 135 | { |
136 | sctp_sctphdr_t _hdr, *hp; | 136 | const struct sctphdr *hp; |
137 | struct sctphdr _hdr; | ||
137 | 138 | ||
138 | /* Actually only need first 8 bytes. */ | 139 | /* Actually only need first 8 bytes. */ |
139 | hp = skb_header_pointer(skb, dataoff, 8, &_hdr); | 140 | hp = skb_header_pointer(skb, dataoff, 8, &_hdr); |
@@ -291,8 +292,10 @@ static int sctp_packet(struct nf_conn *ct, | |||
291 | { | 292 | { |
292 | enum sctp_conntrack new_state, old_state; | 293 | enum sctp_conntrack new_state, old_state; |
293 | enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); | 294 | enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); |
294 | sctp_sctphdr_t _sctph, *sh; | 295 | const struct sctphdr *sh; |
295 | sctp_chunkhdr_t _sch, *sch; | 296 | struct sctphdr _sctph; |
297 | const struct sctp_chunkhdr *sch; | ||
298 | struct sctp_chunkhdr _sch; | ||
296 | u_int32_t offset, count; | 299 | u_int32_t offset, count; |
297 | unsigned long map[256 / sizeof(unsigned long)] = { 0 }; | 300 | unsigned long map[256 / sizeof(unsigned long)] = { 0 }; |
298 | 301 | ||
@@ -393,8 +396,10 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb, | |||
393 | unsigned int dataoff) | 396 | unsigned int dataoff) |
394 | { | 397 | { |
395 | enum sctp_conntrack new_state; | 398 | enum sctp_conntrack new_state; |
396 | sctp_sctphdr_t _sctph, *sh; | 399 | const struct sctphdr *sh; |
397 | sctp_chunkhdr_t _sch, *sch; | 400 | struct sctphdr _sctph; |
401 | const struct sctp_chunkhdr *sch; | ||
402 | struct sctp_chunkhdr _sch; | ||
398 | u_int32_t offset, count; | 403 | u_int32_t offset, count; |
399 | unsigned long map[256 / sizeof(unsigned long)] = { 0 }; | 404 | unsigned long map[256 / sizeof(unsigned long)] = { 0 }; |
400 | 405 | ||