null_check_for_ipv4_config.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. In networks that don't have a DHCP server configured, ipv4 address
  2. allocation fails and the ipv4 structure doesn't get populated. When
  3. the GUI is trying to read the ipv4_config.method field to see whether
  4. it contains "dhcp" string, a segmentation fault is generated.
  5. Ethernet manual configuration behavior remains unchanged after this fix.
  6. Upstream-Status: Pending
  7. Signed-off-by: Emilia Ciobanu <emilia.maria.silvia.ciobanu@intel.com>
  8. Index: git/properties/ethernet.c
  9. ===================================================================
  10. --- git.orig/properties/ethernet.c
  11. +++ git/properties/ethernet.c
  12. @@ -194,7 +194,7 @@ void add_ethernet_service(GtkWidget *mai
  13. data->button = button;
  14. - if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
  15. + if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
  16. update_ethernet_ipv4(data, CONNMAN_POLICY_DHCP);
  17. else
  18. update_ethernet_ipv4(data, CONNMAN_POLICY_MANUAL);
  19. Index: git/properties/wifi.c
  20. ===================================================================
  21. --- git.orig/properties/wifi.c
  22. +++ git/properties/wifi.c
  23. @@ -230,7 +230,7 @@ static void wifi_ipconfig(GtkWidget *tab
  24. data->ipv4_config = ipv4_config;
  25. - if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
  26. + if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
  27. update_wifi_ipv4(data, CONNMAN_POLICY_DHCP);
  28. else
  29. update_wifi_ipv4(data, CONNMAN_POLICY_MANUAL);