ソースを参照

Use whole bytes for the ACKED and RCVD portions of tcp_state; it

produces slightly smaller code.
tags/v0.9.3
Michael Brown 18年前
コミット
b91b9d3d88
1個のファイルの変更3行の追加3行の削除
  1. 3
    3
      src/include/gpxe/tcp.h

+ 3
- 3
src/include/gpxe/tcp.h ファイルの表示

@@ -58,15 +58,15 @@ struct tcp_header {
58 58
  * Note that this applies only to SYN and FIN.
59 59
  */
60 60
 #define TCP_STATE_ACKED(flags) ( (flags) << 8 )
61
-#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0x03 )
61
+#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0xff )
62 62
 
63 63
 /** TCP flags that have been received from the peer
64 64
  *
65 65
  * Note that this applies only to SYN and FIN, and that once SYN has
66 66
  * been received, we should always be sending ACK.
67 67
  */
68
-#define TCP_STATE_RCVD(flags) ( (flags) << 12 )
69
-#define TCP_FLAGS_RCVD(state) ( ( (state) >> 12 ) & 0x03 )
68
+#define TCP_STATE_RCVD(flags) ( (flags) << 16 )
69
+#define TCP_FLAGS_RCVD(state) ( ( (state) >> 16 ) & 0xff )
70 70
 
71 71
 /** TCP flags that are currently being sent in outgoing packets */
72 72
 #define TCP_FLAGS_SENDING(state) \

読み込み中…
キャンセル
保存