Change in libosmocore[master]: osmo_sockaddr_str: fix 32bit addr mixup of host/network byte order

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Wed Nov 13 15:45:50 UTC 2019


neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/16030 )

Change subject: osmo_sockaddr_str: fix 32bit addr mixup of host/network byte order
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/libosmocore/+/16030/2/src/sockaddr_str.c 
File src/sockaddr_str.c:

https://gerrit.osmocom.org/c/libosmocore/+/16030/2/src/sockaddr_str.c@409 
PS2, Line 409: /*! Convert osmo_sockaddr_str address string to IPv4 address data in host-byte-order.
> The API (osmo_sockaddr_str_to_32n) was already defined correctly, since it states it converted from  […]
no, that is not an option. osmo_sockaddr_str_to_32n() is already being used in programs. Regardless of what the API doc said and what I was thinking when using that function, if we modify the effect of this function, then we break those other programs. They are using host-byte-order and they need host-byte-order, and are calling osmo_sockaddr_str_{to,from}_32n() to obtain that. They should move to *_32h() whenever ready, we cannot change the behavior of this function without renaming.

osmo_sockaddr_str_to_32() already does network byte order correctly.
There we can just fix the API doc, because it remains ABI compatible.

Actually almost no-one anywhere needs host byte order, except our MNCC socket it seems.
I wish I had never added _32n()... but now that it's there, I followed through with the _32h() version.
(should be just deprecate without replacement instead?)



-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/16030
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3cf150cc0cc06dd36039fbde091bc71b01697322
Gerrit-Change-Number: 16030
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Wed, 13 Nov 2019 15:45:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191113/124e6ffd/attachment.htm>


More information about the gerrit-log mailing list