network: Fix hotspot silently failing with long hostname
By truncating the SSID to 32 bytes. network-cc-panel-WARNING **: Failed to add new connection: (32) 802-11-wireless.ssid: SSID length is out of range <1-32> bytes See https://bugzilla.redhat.com/show_bug.cgi?id=1309331
This commit is contained in:
parent
1ce4af4267
commit
e66941753b
1 changed files with 6 additions and 10 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <polkit/polkit.h>
|
||||
|
||||
#include "shell/list-box-helper.h"
|
||||
#include "shell/hostname-helper.h"
|
||||
#include "network-dialogs.h"
|
||||
#include "panel-common.h"
|
||||
|
||||
|
@ -878,14 +879,6 @@ get_hostname (void)
|
|||
g_variant_unref (res);
|
||||
}
|
||||
|
||||
if (str == NULL || *str == '\0') {
|
||||
str = g_strdup (g_get_host_name ());
|
||||
}
|
||||
|
||||
if (str == NULL || *str == '\0') {
|
||||
str = g_strdup ("GNOME");
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
@ -893,9 +886,12 @@ static GByteArray *
|
|||
generate_ssid_for_hotspot (NetDeviceWifi *device_wifi)
|
||||
{
|
||||
GByteArray *ssid_array;
|
||||
gchar *ssid;
|
||||
gchar *hostname, *ssid;
|
||||
|
||||
hostname = get_hostname ();
|
||||
ssid = pretty_hostname_to_ssid (hostname);
|
||||
g_free (hostname);
|
||||
|
||||
ssid = get_hostname ();
|
||||
ssid_array = ssid_to_byte_array (ssid);
|
||||
g_free (ssid);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue