-
Notifications
You must be signed in to change notification settings - Fork 58
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
Apply option local port #222
Conversation
tests/dtls-client.c
Outdated
case -1 : | ||
/* handle arguments */ | ||
if (!dst.size) { | ||
/* resolve destination address where server should be sent */ | ||
res = resolve_address(argv[optind++], &dst.addr.sa); |
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.
I'm not convinced that this is the best way do do this (very unusual), moving the logic processing the arguments to within the getopt()
logic, and fail to see why it is actually needed. If this is done, at a minimum dtls_set_log_level(log_level);
needs to be included at the start.
I think that simply removing the use of port_str
, using the new local_port
or DEFAULT_PORT
in the appropriate places along with the other changes should should work
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.
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.
Ah - yes, this really should be against #221.
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.
I already copied your comment ;-)
daec394
to
452fb25
Compare
452fb25
to
3264aa9
Compare
3264aa9
to
a8473ea
Compare
a8473ea
to
0a6d10a
Compare
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.
Just a small comment: Technically, there is no "IPv4 port" or "IPv6 port" as described in the comments prior to the bind. As I think that this is useful to differentiate these two cases, I am entirely ok with leaving it like this.
0a6d10a
to
03489f7
Compare
I guess, adding a ',' will be an improvement :-)
|
The previous version ignores the option for the local port. That may be caused by issues using the same default local port for the server and client. This enables the use of an specific local port and changes the default to an ephemeral free port, similar to quite a lot of other UDP clients. The DEFAULT_PORT is therefore only used for the destination. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
03489f7
to
559f37d
Compare
The previous version ignores the option for the local port. That may be
caused by issues using the same default local port for the server and
client.
This enables the use of an specific local port and changes the default
to an ephemeral free port, similar to quite a lot of other UDP clients.
The DEFAULT_PORT is therefore only used for the destination.