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

Increase log level for dropped packet in sip_transport #3480

Merged
merged 2 commits into from Apr 5, 2023
Merged

Conversation

sauwming
Copy link
Member

@sauwming sauwming commented Apr 4, 2023

To fix #3476.

Currently, in sip_transport, when we receive a malformed packet, we will output the following log:

PJ_LOG(1, (THIS_FILE, 
               "Error processing %ld bytes packet from %s %s:%d %.*s:\n"
               "%.*s\n"

Even though the log message contains the word "error", it's actually not a fatal error since the we will just drop/ignore the packet anyway.

This causes problems if there are some entities who keep sending rogue packets since the log will keep being printed and since the level is the highest, it can't be disabled and may even trigger unwanted actions.

Just for comparisons, other components have correctly used the appropriate log level:
https://github.com/pjsip/pjproject/blob/master/pjsip/src/pjsip/sip_endpoint.c#L1083

https://github.com/pjsip/pjproject/blob/master/pjsip/src/pjsip/sip_dialog.c#L1800

So in this PR, we will increase the log level and change the message to better reflect the circumstances.

Special thanks to @cristalink for the discussion and proposed fix.

@sauwming sauwming merged commit 2c4bf48 into master Apr 5, 2023
34 checks passed
@sauwming sauwming deleted the sip-tp-drop branch April 5, 2023 02:23
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.

Invalid inbound binary data should not be logged with %s, and probably not as ERROR
3 participants