Change in osmo-mgw[master]: mgw: Initial IPv6 support

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Sep 3 13:30:06 UTC 2020


laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19969 )

Change subject: mgw: Initial IPv6 support
......................................................................


Patch Set 1: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/c/osmo-mgw/+/19969/1/src/libosmo-mgcp/mgcp_network.c 
File src/libosmo-mgcp/mgcp_network.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/19969/1/src/libosmo-mgcp/mgcp_network.c@80 
PS1, Line 80: static bool addr_is_any(struct osmo_sockaddr *osa) {
            : 	if (osa->u.sa.sa_family == AF_INET6) {
            : 		struct in6_addr ip6_any = IN6ADDR_ANY_INIT;
            : 		return memcmp(&osa->u.sin6.sin6_addr,
            : 				   &ip6_any, sizeof(ip6_any)) == 0;
            : 	} else {
            : 		return osa->u.sin.sin_addr.s_addr == 0;
            : 	}
            : }
shouldn't we by now have a generic helper for this in libosmocore? I think I've seen something like this multiple times in past weeks


https://gerrit.osmocom.org/c/osmo-mgw/+/19969/1/src/libosmo-mgcp/mgcp_sdp.c 
File src/libosmo-mgcp/mgcp_sdp.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/19969/1/src/libosmo-mgcp/mgcp_sdp.c@266 
PS1, Line 266: static int audio_ip_from_sdp(struct osmo_sockaddr *dst_addr, char *sdp)
             : {
             : 	bool is_ipv6;
             : 	char ipbuf[INET6_ADDRSTRLEN];
             : 	if (strncmp("c=IN IP", sdp, 7) != 0)
             : 		return -1;
             : 	sdp += 7;
             : 	if (*sdp == '6')
             : 	       is_ipv6 = true;
             : 	else if (*sdp == '4')
             : 	       is_ipv6 = false;
             : 	else
             : 	       return -1;
             : 	sdp++;
             : 	if (*sdp != ' ')
             : 		return -1;
             : 	sdp++;
             : 	if (is_ipv6) {
             : 		/* 45 = INET6_ADDRSTRLEN -1 */
             : 		if (sscanf(sdp, "%45s", ipbuf) != 1)
             : 			return -1;
             : 		if (inet_pton(AF_INET6, ipbuf, &dst_addr->u.sin6.sin6_addr) != 1)
             : 			return -1;
             : 		dst_addr->u.sa.sa_family = AF_INET6;
             : 	} else {
             : 		/* 15 = INET_ADDRSTRLEN -1 */
             : 		if (sscanf(sdp, "%15s", ipbuf) != 1)
             : 			return -1;
             : 		if (inet_pton(AF_INET, ipbuf, &dst_addr->u.sin.sin_addr) != 1)
             : 			return -1;
             : 		dst_addr->u.sa.sa_family = AF_INET;
             : 	}
             : 	return 0;
             : }
I thoguht something like this was also in libosmo-mgcp-client patches recently? Is there a chance to unify that code?



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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I504ca776d88fd852bbaef07060c125980db3fdd7
Gerrit-Change-Number: 19969
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Comment-Date: Thu, 03 Sep 2020 13:30:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200903/759867b0/attachment.htm>


More information about the gerrit-log mailing list