-
Notifications
You must be signed in to change notification settings - Fork 505
pcm-sensor-server: add bind ip argument #938
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
Open
marenz2569
wants to merge
5
commits into
intel:master
Choose a base branch
from
marenz2569:marenz.pcm_sensor_server_bind_ip
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
be10f70
pcm-sensor-server: add bind ip argument
marenz2569 df18c34
pcm-sensor-server: use -l for bind ip
marenz2569 6d2d67d
pcm-sensor-server: update docs for ip6 address bind
marenz2569 02e79be
Merge branch 'master' into marenz.pcm_sensor_server_bind_ip
marenz2569 949cbbe
fix ipv6 formatting and remame variables to highlight that this is no…
marenz2569 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 still prefer using -i and or use a long option --ipv6 or so. What about ipv4? Why only ipv6?
Uh oh!
There was an error while loading. Please reload this page.
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 would need to refactor the
HTTPServer
andServer
class to both accept ipv4 and/or ipv6. Currently theServer
class uses ipv6 only internally.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.
Server class uses dual IP stack properties on Linux, no need to be specific.
Anyway you use a string to pass it around, what refactoring would that require?
But before we continue this, why exactly do you need to pass an IPv6 address in here? By default it should take all addresses, ipv4 and ipv6, is this not working for you?
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.
As you said, currently the server listens on
::
. This is working.I'd like to specify the address the server is listening on. To the best of my knowledge I would need to specify AF_INET to listen on a specific v4 address or AF_INET6 to listen on a specific v6 address. Currently the
Server
class is using AF_INET6 internally.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.
IPv4 addresses can be represented as ipv6 addresses, see RFC 4291 for details but it looks like ::ffff:d.d.d.d, d.d.d.d is the ipv4 address just like normal using decimal format, not hexadecimal like ipv6. This would be one way to make it listen on an ipv4 address while still using AF_INET6 but i am not sure this is needed. Going the route of ipv4 mapped ipv6 addresses means the URL IPv6 validator needs to be fixed, it does not account for this format. That is an oversight on my part when writing that IPv6 validation in URL.
Uh oh!
There was an error while loading. Please reload this page.
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.
Caveat: I have not tested my IPv6 code on a system that does not support IPv6 (are there still some around?) so i do not know what :: using AF_INET6 does on such a system that can only handle IPv4...