-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validations/alerts for packet ranges #3309
base: master
Are you sure you want to change the base?
Add validations/alerts for packet ranges #3309
Conversation
this makes addPacket macro for HPM plugins to properly alert users when their packets are ignored due to being out of the supported range, this was previously silently ignored
Uhh... I am really confused now. CI is failing because httpsample registers packets below MIN_PACKET_DB: addProxyPacket(API_MSG_SAMPLE_LOGIN /* 20 < 36 */, sample_login_request, sample_login_api_packet, hpProxy_ApiLogin); But looking at the list of packets from the API-server, all of them are Checking how HPM handles it, it seems to have a loop before the main packet handling that if it finds this packet, it does everything itself (even for non API ones): if (VECTOR_LENGTH(HPM->packets[hpParse_FromLogin]) > 0) {
int result = HPM->parse_packets(fd,command,hpParse_FromLogin);
if (result == 1) // Parsed and handled
continue;
if (result == 2) // Incomplete packet
return 0;
} and Anyways, now I am in doubt about the better approach here... Adding something out of the supported range does seem wrong, so it would be better to just change the sample. But I am wondering why the API-server is fine with that and whether we really want to keep it outside the range. @4144 / @MishimaHaruna / @skyleo any suggestions? |
I'm looking at how those packets work and if I'm understanding it right I think it's a bit of a hack in order to reuse the HPM's packet id/handler dispatch logic for the proxied API messages. Even though they're inserted into the HPM's packet database (in dedicated sections, You can see how they're used i.e. in
For the purpose of this PR, I think you can simply skip the error reporting if |
Pull Request Prelude
Changes Proposed
MAX_PACKET_DB
is within 2 bytes range (currentlypacketType
is 2 bytes long)Issues addressed:
None, discussed in discord; thanks to csnv and dastgirp for bringing these up