File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -223,33 +223,23 @@ void nf_reject_ip6_tcphdr_put(struct sk_buff *nskb,
223
223
const struct tcphdr * oth , unsigned int otcplen )
224
224
{
225
225
struct tcphdr * tcph ;
226
- int needs_ack ;
227
226
228
227
skb_reset_transport_header (nskb );
229
- tcph = skb_put (nskb , sizeof (struct tcphdr ));
228
+ tcph = skb_put_zero (nskb , sizeof (struct tcphdr ));
230
229
/* Truncate to length (no data) */
231
230
tcph -> doff = sizeof (struct tcphdr )/4 ;
232
231
tcph -> source = oth -> dest ;
233
232
tcph -> dest = oth -> source ;
234
233
235
234
if (oth -> ack ) {
236
- needs_ack = 0 ;
237
235
tcph -> seq = oth -> ack_seq ;
238
- tcph -> ack_seq = 0 ;
239
236
} else {
240
- needs_ack = 1 ;
241
237
tcph -> ack_seq = htonl (ntohl (oth -> seq ) + oth -> syn + oth -> fin +
242
238
otcplen - (oth -> doff <<2 ));
243
- tcph -> seq = 0 ;
239
+ tcph -> ack = 1 ;
244
240
}
245
241
246
- /* Reset flags */
247
- ((u_int8_t * )tcph )[13 ] = 0 ;
248
242
tcph -> rst = 1 ;
249
- tcph -> ack = needs_ack ;
250
- tcph -> window = 0 ;
251
- tcph -> urg_ptr = 0 ;
252
- tcph -> check = 0 ;
253
243
254
244
/* Adjust TCP checksum */
255
245
tcph -> check = csum_ipv6_magic (& ipv6_hdr (nskb )-> saddr ,
You can’t perform that action at this time.
0 commit comments