Fix WPS UPnP SSDP on 32-bit targets
[wpasupplicant] / src / wps / wps_upnp_ssdp.c
index 71dcc96..47be476 100644 (file)
@@ -51,7 +51,7 @@ static int token_eq(const char *s1, const char *s2)
                if (end1 || end2 || c1 != c2)
                        break;
        }
-       return (end1 && end2);  /* reached end of both words? */
+       return end1 && end2; /* reached end of both words? */
 }
 
 
@@ -359,10 +359,9 @@ void msearchreply_state_machine_stop(struct advertisement_state_machine *a)
        wpa_printf(MSG_DEBUG, "WPS UPnP: M-SEARCH stop");
        if (a->next == a) {
                sm->msearch_replies = NULL;
-       } else  {
-               if (sm->msearch_replies == a) {
+       } else {
+               if (sm->msearch_replies == a)
                        sm->msearch_replies = a->next;
-               }
                a->next->prev = a->prev;
                a->prev->next = a->next;
        }
@@ -462,7 +461,7 @@ static void msearchreply_state_machine_start(struct upnp_wps_device_sm *sm,
        a->type = MSEARCH_REPLY;
        a->state = 0;
        a->sm = sm;
-       os_memcpy(&a->client, client, sizeof(client));
+       os_memcpy(&a->client, client, sizeof(*client));
        /* Wait time depending on MX value */
        next_timeout_msec = (1000 * mx * (os_random() & 0xFF)) >> 8;
        next_timeout_sec = next_timeout_msec / 1000;
@@ -785,6 +784,7 @@ fail:
  */
 int add_ssdp_network(char *net_if)
 {
+#ifdef __linux__
        int ret = -1;
        int sock = -1;
        struct rtentry rt;
@@ -827,6 +827,9 @@ fail:
                close(sock);
 
        return ret;
+#else /* __linux__ */
+       return 0;
+#endif /* __linux__ */
 }