Miscellaneous patches for 2017-03-28

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJY2pR6AAoJEDhwtADrkYZTj2oP/ik7CN46BDvZGTWuqS7TwElY
 sIEY39PdeTFGk1EqfeNLmkmsg3uvzkumiuzaScNgct1ZD04T+UoTv2qpK9wURS5q
 r66Ee9gTz4PfQZJ4YTB96ELDLI7G6pRk2frtBXhavUi0vjMbRKfGfJepdCxFCy3C
 CFM8GGYg6dn6KHe0C7KYv7Gb1WQvQozFVPVZraPedACFqQzY2b0BgFJB/OscC0OG
 m9f3Nd5EA93gAHV4IIMI5VO5wI+60HRME0CBwAN8oIlrilTBM+M6Y4++VvAeTRk5
 l69NV+vEFhWZIfC7NVkPt4Hk4WcV1QRp1j/LxkgHwjU8xTC1IUpQDmy+9d9lvme6
 Qke7S/9cNaekWN98+RjWTsuHcoCf8RfNAE0D6X2ZiHQp9ndDyofiTVH0fNB6cMFr
 0clsjKI8ZjwZI0OQFG9K3KjI5dlGHPgfywzOlkqrBcCvjUeJktddBP6uFBYT+YQI
 O2CxJOPo8IOUUviRnYxjD4wCYZ6ax1ECifFE7Z+/7FRAuehAEZyTpGHk5Vn8avRG
 LW5OBS1efPCQBgTj8VgVQrPW7hbgKLY+ZMHCn9VomtkM047yCUHS7ZUV/ooLf3fz
 QLzmkE6dQUsBOjnF3d4YtImVo+2S7SdvU+2UM6vmyBrEgqfiShGiw3b4/Iq/Jy8S
 aAnTTL1pNFL7AT3XltiH
 =KP0J
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2017-03-28' into staging

Miscellaneous patches for 2017-03-28

# gpg: Signature made Tue 28 Mar 2017 17:51:06 BST
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-misc-2017-03-28:
  sockets: Fix socket_address_to_string() hostname truncation

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-03-28 18:37:32 +01:00
commit a634bbbafc

View File

@ -1307,19 +1307,14 @@ char *socket_address_to_string(struct SocketAddress *addr, Error **errp)
{
char *buf;
InetSocketAddress *inet;
char host_port[INET6_ADDRSTRLEN + 5 + 4];
switch (addr->type) {
case SOCKET_ADDRESS_KIND_INET:
inet = addr->u.inet.data;
if (strchr(inet->host, ':') == NULL) {
snprintf(host_port, sizeof(host_port), "%s:%s", inet->host,
inet->port);
buf = g_strdup(host_port);
buf = g_strdup_printf("%s:%s", inet->host, inet->port);
} else {
snprintf(host_port, sizeof(host_port), "[%s]:%s", inet->host,
inet->port);
buf = g_strdup(host_port);
buf = g_strdup_printf("[%s]:%s", inet->host, inet->port);
}
break;