aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-08-17 16:42:25 -0400
committerDavid S. Miller <davem@davemloft.net>2015-08-18 00:33:06 -0400
commit4b048d6d9d0b0b90e1e94f2393796bbf1fa8df4e (patch)
tree0e94118e10507b79263054ac47b1166e8a4be220 /net/netfilter
parent2536862311d2276454ddef9dc36d6551a4b400fd (diff)
net: Change pseudohdr argument of inet_proto_csum_replace* to be a bool
inet_proto_csum_replace4,2,16 take a pseudohdr argument which indicates the checksum field carries a pseudo header. This argument should be a boolean instead of an int. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_conntrack_seqadj.c9
-rw-r--r--net/netfilter/nf_nat_proto_dccp.c2
-rw-r--r--net/netfilter/nf_nat_proto_tcp.c2
-rw-r--r--net/netfilter/nf_nat_proto_udp.c2
-rw-r--r--net/netfilter/nf_nat_proto_udplite.c2
-rw-r--r--net/netfilter/nf_synproxy_core.c2
-rw-r--r--net/netfilter/xt_TCPMSS.c8
-rw-r--r--net/netfilter/xt_TCPOPTSTRIP.c2
8 files changed, 15 insertions, 14 deletions
diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index ce3e840c8704..dff0f0cc59e4 100644
--- a/net/netfilter/nf_conntrack_seqadj.c
+++ b/net/netfilter/nf_conntrack_seqadj.c
@@ -103,9 +103,9 @@ static void nf_ct_sack_block_adjust(struct sk_buff *skb,
103 ntohl(sack->end_seq), ntohl(new_end_seq)); 103 ntohl(sack->end_seq), ntohl(new_end_seq));
104 104
105 inet_proto_csum_replace4(&tcph->check, skb, 105 inet_proto_csum_replace4(&tcph->check, skb,
106 sack->start_seq, new_start_seq, 0); 106 sack->start_seq, new_start_seq, false);
107 inet_proto_csum_replace4(&tcph->check, skb, 107 inet_proto_csum_replace4(&tcph->check, skb,
108 sack->end_seq, new_end_seq, 0); 108 sack->end_seq, new_end_seq, false);
109 sack->start_seq = new_start_seq; 109 sack->start_seq = new_start_seq;
110 sack->end_seq = new_end_seq; 110 sack->end_seq = new_end_seq;
111 sackoff += sizeof(*sack); 111 sackoff += sizeof(*sack);
@@ -193,8 +193,9 @@ int nf_ct_seq_adjust(struct sk_buff *skb,
193 newseq = htonl(ntohl(tcph->seq) + seqoff); 193 newseq = htonl(ntohl(tcph->seq) + seqoff);
194 newack = htonl(ntohl(tcph->ack_seq) - ackoff); 194 newack = htonl(ntohl(tcph->ack_seq) - ackoff);
195 195
196 inet_proto_csum_replace4(&tcph->check, skb, tcph->seq, newseq, 0); 196 inet_proto_csum_replace4(&tcph->check, skb, tcph->seq, newseq, false);
197 inet_proto_csum_replace4(&tcph->check, skb, tcph->ack_seq, newack, 0); 197 inet_proto_csum_replace4(&tcph->check, skb, tcph->ack_seq, newack,
198 false);
198 199
199 pr_debug("Adjusting sequence number from %u->%u, ack from %u->%u\n", 200 pr_debug("Adjusting sequence number from %u->%u, ack from %u->%u\n",
200 ntohl(tcph->seq), ntohl(newseq), ntohl(tcph->ack_seq), 201 ntohl(tcph->seq), ntohl(newseq), ntohl(tcph->ack_seq),
diff --git a/net/netfilter/nf_nat_proto_dccp.c b/net/netfilter/nf_nat_proto_dccp.c
index b8067b53ff3a..15c47b246d0d 100644
--- a/net/netfilter/nf_nat_proto_dccp.c
+++ b/net/netfilter/nf_nat_proto_dccp.c
@@ -69,7 +69,7 @@ dccp_manip_pkt(struct sk_buff *skb,
69 l3proto->csum_update(skb, iphdroff, &hdr->dccph_checksum, 69 l3proto->csum_update(skb, iphdroff, &hdr->dccph_checksum,
70 tuple, maniptype); 70 tuple, maniptype);
71 inet_proto_csum_replace2(&hdr->dccph_checksum, skb, oldport, newport, 71 inet_proto_csum_replace2(&hdr->dccph_checksum, skb, oldport, newport,
72 0); 72 false);
73 return true; 73 return true;
74} 74}
75 75
diff --git a/net/netfilter/nf_nat_proto_tcp.c b/net/netfilter/nf_nat_proto_tcp.c
index 37f5505f4529..4f8820fc5148 100644
--- a/net/netfilter/nf_nat_proto_tcp.c
+++ b/net/netfilter/nf_nat_proto_tcp.c
@@ -70,7 +70,7 @@ tcp_manip_pkt(struct sk_buff *skb,
70 return true; 70 return true;
71 71
72 l3proto->csum_update(skb, iphdroff, &hdr->check, tuple, maniptype); 72 l3proto->csum_update(skb, iphdroff, &hdr->check, tuple, maniptype);
73 inet_proto_csum_replace2(&hdr->check, skb, oldport, newport, 0); 73 inet_proto_csum_replace2(&hdr->check, skb, oldport, newport, false);
74 return true; 74 return true;
75} 75}
76 76
diff --git a/net/netfilter/nf_nat_proto_udp.c b/net/netfilter/nf_nat_proto_udp.c
index b0ede2f0d8bc..b1e627227b6e 100644
--- a/net/netfilter/nf_nat_proto_udp.c
+++ b/net/netfilter/nf_nat_proto_udp.c
@@ -57,7 +57,7 @@ udp_manip_pkt(struct sk_buff *skb,
57 l3proto->csum_update(skb, iphdroff, &hdr->check, 57 l3proto->csum_update(skb, iphdroff, &hdr->check,
58 tuple, maniptype); 58 tuple, maniptype);
59 inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport, 59 inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport,
60 0); 60 false);
61 if (!hdr->check) 61 if (!hdr->check)
62 hdr->check = CSUM_MANGLED_0; 62 hdr->check = CSUM_MANGLED_0;
63 } 63 }
diff --git a/net/netfilter/nf_nat_proto_udplite.c b/net/netfilter/nf_nat_proto_udplite.c
index 368f14e01e75..58340c97bd83 100644
--- a/net/netfilter/nf_nat_proto_udplite.c
+++ b/net/netfilter/nf_nat_proto_udplite.c
@@ -56,7 +56,7 @@ udplite_manip_pkt(struct sk_buff *skb,
56 } 56 }
57 57
58 l3proto->csum_update(skb, iphdroff, &hdr->check, tuple, maniptype); 58 l3proto->csum_update(skb, iphdroff, &hdr->check, tuple, maniptype);
59 inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport, 0); 59 inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport, false);
60 if (!hdr->check) 60 if (!hdr->check)
61 hdr->check = CSUM_MANGLED_0; 61 hdr->check = CSUM_MANGLED_0;
62 62
diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
index d7f168527903..14f8b43ec5a7 100644
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -225,7 +225,7 @@ unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
225 synproxy->tsoff); 225 synproxy->tsoff);
226 } 226 }
227 inet_proto_csum_replace4(&th->check, skb, 227 inet_proto_csum_replace4(&th->check, skb,
228 old, *ptr, 0); 228 old, *ptr, false);
229 return 1; 229 return 1;
230 } 230 }
231 optoff += op[1]; 231 optoff += op[1];
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 8c3190e2fc6a..8c02501a530f 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -144,7 +144,7 @@ tcpmss_mangle_packet(struct sk_buff *skb,
144 144
145 inet_proto_csum_replace2(&tcph->check, skb, 145 inet_proto_csum_replace2(&tcph->check, skb,
146 htons(oldmss), htons(newmss), 146 htons(oldmss), htons(newmss),
147 0); 147 false);
148 return 0; 148 return 0;
149 } 149 }
150 } 150 }
@@ -185,18 +185,18 @@ tcpmss_mangle_packet(struct sk_buff *skb,
185 memmove(opt + TCPOLEN_MSS, opt, len - sizeof(struct tcphdr)); 185 memmove(opt + TCPOLEN_MSS, opt, len - sizeof(struct tcphdr));
186 186
187 inet_proto_csum_replace2(&tcph->check, skb, 187 inet_proto_csum_replace2(&tcph->check, skb,
188 htons(len), htons(len + TCPOLEN_MSS), 1); 188 htons(len), htons(len + TCPOLEN_MSS), true);
189 opt[0] = TCPOPT_MSS; 189 opt[0] = TCPOPT_MSS;
190 opt[1] = TCPOLEN_MSS; 190 opt[1] = TCPOLEN_MSS;
191 opt[2] = (newmss & 0xff00) >> 8; 191 opt[2] = (newmss & 0xff00) >> 8;
192 opt[3] = newmss & 0x00ff; 192 opt[3] = newmss & 0x00ff;
193 193
194 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), 0); 194 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), false);
195 195
196 oldval = ((__be16 *)tcph)[6]; 196 oldval = ((__be16 *)tcph)[6];
197 tcph->doff += TCPOLEN_MSS/4; 197 tcph->doff += TCPOLEN_MSS/4;
198 inet_proto_csum_replace2(&tcph->check, skb, 198 inet_proto_csum_replace2(&tcph->check, skb,
199 oldval, ((__be16 *)tcph)[6], 0); 199 oldval, ((__be16 *)tcph)[6], false);
200 return TCPOLEN_MSS; 200 return TCPOLEN_MSS;
201} 201}
202 202
diff --git a/net/netfilter/xt_TCPOPTSTRIP.c b/net/netfilter/xt_TCPOPTSTRIP.c
index 625fa1d636a0..eb92bffff11c 100644
--- a/net/netfilter/xt_TCPOPTSTRIP.c
+++ b/net/netfilter/xt_TCPOPTSTRIP.c
@@ -80,7 +80,7 @@ tcpoptstrip_mangle_packet(struct sk_buff *skb,
80 n <<= 8; 80 n <<= 8;
81 } 81 }
82 inet_proto_csum_replace2(&tcph->check, skb, htons(o), 82 inet_proto_csum_replace2(&tcph->check, skb, htons(o),
83 htons(n), 0); 83 htons(n), false);
84 } 84 }
85 memset(opt + i, TCPOPT_NOP, optl); 85 memset(opt + i, TCPOPT_NOP, optl);
86 } 86 }