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

lcr: source port check for from_any_gw() and from_gw(). #2832

Merged
merged 2 commits into from Aug 25, 2021
Merged

lcr: source port check for from_any_gw() and from_gw(). #2832

merged 2 commits into from Aug 25, 2021

Conversation

zenichev
Copy link
Contributor

@zenichev zenichev commented Aug 23, 2021

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

A simple change, which allows to check, if a coming request matches
not only by an IP address and a transport protocol,
but also using the source port of a request.

Improvements are done for the following functions of the lcr module:

  • from_any_gw()
  • from_gw()

Back compatibility provided, hence it does not affect already existing behavior.

A simple change, which allows to check, if a coming request matches
not only by an IP address and a transport protocol,
but also using the source port of a request.

Improvements are done for the following functions of the lcr module:
- from_any_gw()
- from_gw()

Back compatibility provided, hence it does not affect already existing behavior.
@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2021

This pull request introduces 2 alerts when merging 14e6fc8 into 5ad81a4 - view on LGTM.com

new alerts:

  • 2 for Comparison result is always the same

@henningw
Copy link
Contributor

Thanks for the pull request. There are two alerts mentioned above (check for < 0 for an unsigned int is obviously not necessary), please have a look to it. After fixing you can push to the branch, no need for a new pull request.

Remove unneeded check for 'src_port' in:
- ki_from_any_gw_addr()
- ki_from_gw_addr()

Which makes no sense because 'src_port' is of type 'unsigned int',
and the check concerns whether it's less than 0 or not.
@juha-h
Copy link
Contributor

juha-h commented Aug 24, 2021

I haven't tested the new feature, but from backwards compatibility point of view, the implementation looks good to me. Thus I have nothing against the merge.

@linuxmaniac linuxmaniac merged commit 536736f into kamailio:master Aug 25, 2021
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.

None yet

4 participants