Change in libosmocore[master]: add osmo_ip_port API

Harald Welte gerrit-no-reply at
Tue Mar 5 10:05:32 UTC 2019

Harald Welte has posted comments on this change. ( )

Change subject: add osmo_ip_port API

Patch Set 4:


I'm not opposed to merging this, I'm just raising some random questions that come to my mind.  Feel free to use or ignore them.  To me it seems like quite a bit of extra "abstraction" for what is essentialy containing the exact same information as sockaddr_storage.
File include/osmocom/core/ip_port.h:
PS4, Line 47: osmo_ip_port
basically this looks like you're reinventing sockaddr_storage which is usually typecast to sockaddr_in / sockaddr_in6?

I guess the only difference is that you're keeping the ip address as string, where as sockaddr_* keeps it in binary format.

Is that really worth it?  Could we not simply have a set of utility functions that work on sockaddr_storage instead?  O r are our accesses 99% of the time for the string, and we basically want to cache the string and avoid converting from binary to string all the time?
PS4, Line 51: 46
there is a #define for the maximum length of an IPv6 address in string format somewhere in libc, AFAIR
PS4, Line 80: osmo_ip_port_to_32
normal convention in osmocom is lke memcpy(): Output argument is first, followed by input argument[s].

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
Gerrit-Change-Number: 13123
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-CC: Harald Welte <laforge at>
Gerrit-Comment-Date: Tue, 05 Mar 2019 10:05:32 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list