Commit d3e9693
fix(transport): handle duplicate intro packets during gateway handshake
When a peer restarts with a new identity, the gateway correctly detects this (issue #2277 fix) and creates a new gateway_connection. However, the peer sends multiple RSA intro packets for NAT traversal reliability. After the first intro triggers the new gateway_connection, subsequent intro packets get routed to the ongoing handler instead of being ignored. The handler expected a symmetric ACK response but received a 256-byte RSA intro packet, causing "invalid symmetric key" error. This fix modifies the gateway_connection to: 1. Wait for packets in a loop with a deadline 2. Ignore 256-byte packets (likely duplicate RSA intros) 3. Continue waiting for the real symmetric ACK response 4. Only error out after the deadline expires Fixes #2292 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 6d8f026 commit d3e9693
1 file changed
+58
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
918 | 904 | | |
919 | 905 | | |
920 | 906 | | |
921 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
922 | 958 | | |
923 | 959 | | |
924 | 960 | | |
| |||
0 commit comments