-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support optional socket options #215
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Please add test cases and provide example with description in README
.
Please also run GitHub Actions manually in your fork and provide here the link to success CI.
|
Co-authored-by: Viacheslav Katsuba <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash all commits into single commit.
If I put my test: {timeout,{gen_server,call,[eradius_server_mon,reconfigure]}} but if I put before works. |
please don't do that. Structure you commits in a way that there is a single commit for each logical change. That means, one commit for the spelling (and only those), one for the code formatting changes and one commit for adding the socket options. |
src/eradius_config.erl
Outdated
validate_options(Opts) when is_list(Opts) -> | ||
Opts; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could use a check to restrict the options to the once we want to allow. For example there is no point to allow the binary
(or list
), the active
, ip
and recbuf
options.
Don't do a negative filtering, explicitly check only for allowed options.
A full validation of the content of the options is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: I have introduced validate_socket_options
that checks if a specific options is in a banned list
Hello @meox and thanks for PR. For now eradius UDP server uses options in a kind of mixed way. Some of them are predefined and could not be changed. Besides predefined there is I would suggest to introduce a generic place (and format maybe property list or map) for all socket related options in addition to predefined options. Something like:
So eradius server will start:
or something like this. This will allow to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@RoadRunnr, @0xAX, please take a look again. |
@meox Thanks for the update. I've put some comments, but in general the changes look pretty good and I think it could be merged after clarification the situation with recbuf in eradius_server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after fixing the things related to the last comments.
perfect: ping me if I have to change other stuff! and thanks for the support/suggestions. |
Added a new test to check some cases for the eradius_config:validate_server function |
any chance to merge this branch soon? |
Yep. Merged 😄. Thanks again for your contribution! |
Add the possibility to create a server passing extra options like netns and vrf.
Example: