File tree 1 file changed +2
-12
lines changed
1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -92,33 +92,23 @@ void nf_reject_ip6_tcphdr_put(struct sk_buff *nskb,
92
92
const struct tcphdr * oth , unsigned int otcplen )
93
93
{
94
94
struct tcphdr * tcph ;
95
- int needs_ack ;
96
95
97
96
skb_reset_transport_header (nskb );
98
- tcph = skb_put (nskb , sizeof (struct tcphdr ));
97
+ tcph = skb_put_zero (nskb , sizeof (struct tcphdr ));
99
98
/* Truncate to length (no data) */
100
99
tcph -> doff = sizeof (struct tcphdr )/4 ;
101
100
tcph -> source = oth -> dest ;
102
101
tcph -> dest = oth -> source ;
103
102
104
103
if (oth -> ack ) {
105
- needs_ack = 0 ;
106
104
tcph -> seq = oth -> ack_seq ;
107
- tcph -> ack_seq = 0 ;
108
105
} else {
109
- needs_ack = 1 ;
110
106
tcph -> ack_seq = htonl (ntohl (oth -> seq ) + oth -> syn + oth -> fin +
111
107
otcplen - (oth -> doff <<2 ));
112
- tcph -> seq = 0 ;
108
+ tcph -> ack = 1 ;
113
109
}
114
110
115
- /* Reset flags */
116
- ((u_int8_t * )tcph )[13 ] = 0 ;
117
111
tcph -> rst = 1 ;
118
- tcph -> ack = needs_ack ;
119
- tcph -> window = 0 ;
120
- tcph -> urg_ptr = 0 ;
121
- tcph -> check = 0 ;
122
112
123
113
/* Adjust TCP checksum */
124
114
tcph -> check = csum_ipv6_magic (& ipv6_hdr (nskb )-> saddr ,
You can’t perform that action at this time.
0 commit comments