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,
223223 const struct tcphdr * oth , unsigned int otcplen )
224224{
225225 struct tcphdr * tcph ;
226- int needs_ack ;
227226
228227 skb_reset_transport_header (nskb );
229- tcph = skb_put (nskb , sizeof (struct tcphdr ));
228+ tcph = skb_put_zero (nskb , sizeof (struct tcphdr ));
230229 /* Truncate to length (no data) */
231230 tcph -> doff = sizeof (struct tcphdr )/4 ;
232231 tcph -> source = oth -> dest ;
233232 tcph -> dest = oth -> source ;
234233
235234 if (oth -> ack ) {
236- needs_ack = 0 ;
237235 tcph -> seq = oth -> ack_seq ;
238- tcph -> ack_seq = 0 ;
239236 } else {
240- needs_ack = 1 ;
241237 tcph -> ack_seq = htonl (ntohl (oth -> seq ) + oth -> syn + oth -> fin +
242238 otcplen - (oth -> doff <<2 ));
243- tcph -> seq = 0 ;
239+ tcph -> ack = 1 ;
244240 }
245241
246- /* Reset flags */
247- ((u_int8_t * )tcph )[13 ] = 0 ;
248242 tcph -> rst = 1 ;
249- tcph -> ack = needs_ack ;
250- tcph -> window = 0 ;
251- tcph -> urg_ptr = 0 ;
252- tcph -> check = 0 ;
253243
254244 /* Adjust TCP checksum */
255245 tcph -> check = csum_ipv6_magic (& ipv6_hdr (nskb )-> saddr ,
You can’t perform that action at this time.
0 commit comments