Skip to content
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

closing connection if a fragmented packet is received #2367

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Conversation

robertc2000
Copy link
Collaborator

No description provided.

Comment on lines +728 to +729
if (pkt->ip->proto == 17) pkt->udp = (struct udp *) (pkt->ip + 1);
if (pkt->ip->proto == 6) pkt->tcp = (struct tcp *) (pkt->ip + 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check here the protocol in order to be able to find and close the connection...
I guess there is no other way...

src/net_builtin.c Outdated Show resolved Hide resolved
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_ERROR) {
if (s_sent_fragment) {
ASSERT(strcmp((char*) ev_data, "Received fragmented packet") == 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugly... but Sergey asked for this.

@cpq cpq merged commit fbc56f4 into master Sep 5, 2023
73 checks passed
@cpq cpq deleted the ip-fragmentation branch September 5, 2023 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants