-
Notifications
You must be signed in to change notification settings - Fork 80
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
Use 'getprotobyname' #4
Comments
On Wed, Mar 07, 2012 at 12:33:30AM -0800, Sergei Lebedev wrote:
Hey Sergei! Thanks for the suggestion! Protocol numbers are set by IANA, so they should be consistent between Offhand, I can't think of a reason for changing /etc/protocols but that As for getprotobyname(3), I guess the options are:
-module(pr). l(Proto) when is_atom(Proto) -> find(_Proto, []) -> btoi(Bin) -> What do you think? |
Michael, I wasn't aware that protocol numbers are fixed -- in that case, maybe hardcoding them isn't a bad idea; but overall, I think delegating this part to 'libc' might still be a better solution. Especially since you already have a |
On Wed, Mar 07, 2012 at 09:32:23AM -0800, Sergei Lebedev wrote:
Definitely, should be simple to add. The general idea behind I haven't looked at the code for getprotobyame(3) yet but the Using getprotobyname(3) might actually be risky. If someone did have |
This sounds totally reasonable. I've looked through 'getprotobyname' code and it does nothing special -- so implementing it in Erlang would be just as easy. |
Hello, I think
procket
should call getprotobyname instead of using hardcoded protocol numbers, since the actual values are platform dependant and can be overriden in/etc/protocols/
.The text was updated successfully, but these errors were encountered: