Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[network] Correct the check for broken network interfaces. Fixes: CID#
1230271

The and should be a logical or, otherwise that piece of code does not get
excecuted.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Aug 5, 2014
1 parent 535e6ec commit ea22c60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/usb_moded-network.c
Expand Up @@ -104,7 +104,7 @@ static char* get_interface(struct mode_list_elem *data)
if(interface != NULL)
check = check_interface(interface);

if(interface == NULL && check != 0)
if(interface == NULL || check != 0)
{
interface = malloc(sizeof(default_interface)*sizeof(char));
strncpy(interface, default_interface, sizeof(default_interface));
Expand All @@ -113,7 +113,7 @@ static char* get_interface(struct mode_list_elem *data)
check = check_interface(interface);
if(check)
log_warning("Configured interface is incorrect, nor does usb0 exists. Check your config!\n");
/* TODO: Make it so that interface configuration gets skipped */
/* TODO: Make it so that interface configuration gets skipped when no usable interface exists */

log_debug("interface = %s\n", interface);
return interface;
Expand Down

0 comments on commit ea22c60

Please sign in to comment.