File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,18 @@ impl<'a> TcpSocket<'a> {
246
246
Ok ( ( ) )
247
247
}
248
248
249
+ ( State :: SynReceived , TcpRepr {
250
+ control : TcpControl :: None , ack_number : Some ( ack_number) , ..
251
+ } ) => {
252
+ if ack_number != self . local_seq_no + 1 { return Err ( Error :: Rejected ) }
253
+ self . set_state ( State :: Established ) ;
254
+
255
+ // FIXME: queue data from ACK
256
+ // FIXME: update sequence numbers
257
+ self . retransmit . reset ( ) ;
258
+ Ok ( ( ) )
259
+ }
260
+
249
261
_ => {
250
262
// This will cause the interface to reply with an RST.
251
263
Err ( Error :: Rejected )
@@ -274,6 +286,7 @@ impl<'a> TcpSocket<'a> {
274
286
State :: Listen => {
275
287
return Err ( Error :: Exhausted )
276
288
}
289
+
277
290
State :: SynReceived => {
278
291
if !self . retransmit . check ( ) { return Err ( Error :: Exhausted ) }
279
292
repr. control = TcpControl :: Syn ;
@@ -282,6 +295,12 @@ impl<'a> TcpSocket<'a> {
282
295
net_trace ! ( "tcp:{}:{}: SYN sent" ,
283
296
self . local_end, self . remote_end) ;
284
297
}
298
+
299
+ State :: Established => {
300
+ // FIXME: transmit something
301
+ return Err ( Error :: Exhausted )
302
+ }
303
+
285
304
_ => unreachable ! ( )
286
305
}
287
306
You can’t perform that action at this time.
0 commit comments