Commit 12c33aa2 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Patrick McHardy

[NETFILTER]: nf_conntrack: const annotations in nf_conntrack_sctp, nf_nat_proto_gre

Signed-off-by: default avatarJan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent f2ea825f
...@@ -38,7 +38,7 @@ dccp_manip_pkt(struct sk_buff *skb, ...@@ -38,7 +38,7 @@ dccp_manip_pkt(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple, const struct nf_conntrack_tuple *tuple,
enum nf_nat_manip_type maniptype) enum nf_nat_manip_type maniptype)
{ {
struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); const struct iphdr *iph = (const void *)(skb->data + iphdroff);
struct dccp_hdr *hdr; struct dccp_hdr *hdr;
unsigned int hdroff = iphdroff + iph->ihl * 4; unsigned int hdroff = iphdroff + iph->ihl * 4;
__be32 oldip, newip; __be32 oldip, newip;
......
...@@ -84,7 +84,7 @@ gre_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, ...@@ -84,7 +84,7 @@ gre_manip_pkt(struct sk_buff *skb, unsigned int iphdroff,
const struct nf_conntrack_tuple *tuple, const struct nf_conntrack_tuple *tuple,
enum nf_nat_manip_type maniptype) enum nf_nat_manip_type maniptype)
{ {
struct gre_hdr *greh; const struct gre_hdr *greh;
struct gre_hdr_pptp *pgreh; struct gre_hdr_pptp *pgreh;
const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff);
unsigned int hdroff = iphdroff + iph->ihl * 4; unsigned int hdroff = iphdroff + iph->ihl * 4;
......
...@@ -33,7 +33,7 @@ static DEFINE_RWLOCK(sctp_lock); ...@@ -33,7 +33,7 @@ static DEFINE_RWLOCK(sctp_lock);
And so for me for SCTP :D -Kiran */ And so for me for SCTP :D -Kiran */
static const char *sctp_conntrack_names[] = { static const char *const sctp_conntrack_names[] = {
"NONE", "NONE",
"CLOSED", "CLOSED",
"COOKIE_WAIT", "COOKIE_WAIT",
...@@ -133,7 +133,8 @@ static const u8 sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { ...@@ -133,7 +133,8 @@ static const u8 sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = {
static bool sctp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, static bool sctp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
struct nf_conntrack_tuple *tuple) struct nf_conntrack_tuple *tuple)
{ {
sctp_sctphdr_t _hdr, *hp; const struct sctphdr *hp;
struct sctphdr _hdr;
/* Actually only need first 8 bytes. */ /* Actually only need first 8 bytes. */
hp = skb_header_pointer(skb, dataoff, 8, &_hdr); hp = skb_header_pointer(skb, dataoff, 8, &_hdr);
...@@ -291,8 +292,10 @@ static int sctp_packet(struct nf_conn *ct, ...@@ -291,8 +292,10 @@ static int sctp_packet(struct nf_conn *ct,
{ {
enum sctp_conntrack new_state, old_state; enum sctp_conntrack new_state, old_state;
enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
sctp_sctphdr_t _sctph, *sh; const struct sctphdr *sh;
sctp_chunkhdr_t _sch, *sch; struct sctphdr _sctph;
const struct sctp_chunkhdr *sch;
struct sctp_chunkhdr _sch;
u_int32_t offset, count; u_int32_t offset, count;
unsigned long map[256 / sizeof(unsigned long)] = { 0 }; unsigned long map[256 / sizeof(unsigned long)] = { 0 };
...@@ -393,8 +396,10 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb, ...@@ -393,8 +396,10 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb,
unsigned int dataoff) unsigned int dataoff)
{ {
enum sctp_conntrack new_state; enum sctp_conntrack new_state;
sctp_sctphdr_t _sctph, *sh; const struct sctphdr *sh;
sctp_chunkhdr_t _sch, *sch; struct sctphdr _sctph;
const struct sctp_chunkhdr *sch;
struct sctp_chunkhdr _sch;
u_int32_t offset, count; u_int32_t offset, count;
unsigned long map[256 / sizeof(unsigned long)] = { 0 }; unsigned long map[256 / sizeof(unsigned long)] = { 0 };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment