am 5f6ca22c: (-s ours) am daa60e5c: The P2P configuration file is wrongly set as STA configuration file
* commit '5f6ca22cea74955d5e19d7a13ba7d5046108b0fa':
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 2250e6e..db2d73e 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -1149,7 +1149,7 @@
* and "close notify" shutdown alert would confuse AS. */
SSL_set_quiet_shutdown(conn->ssl, 1);
SSL_shutdown(conn->ssl);
- return 0;
+ return SSL_clear(conn->ssl) == 1 ? 0 : -1;
}
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 9cd3162..f3d45e5 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -583,6 +583,11 @@
r->flags |= WPA_SCAN_LEVEL_INVALID | WPA_SCAN_QUAL_INVALID;
if (bss[NL80211_BSS_TSF])
r->tsf = nla_get_u64(bss[NL80211_BSS_TSF]);
+ if (bss[NL80211_BSS_BEACON_TSF]) {
+ u64 tsf = nla_get_u64(bss[NL80211_BSS_BEACON_TSF]);
+ if (tsf > r->tsf)
+ r->tsf = tsf;
+ }
if (bss[NL80211_BSS_SEEN_MS_AGO])
r->age = nla_get_u32(bss[NL80211_BSS_SEEN_MS_AGO]);
r->ie_len = ie_len;
diff --git a/src/utils/os.h b/src/utils/os.h
index 77250d6..8913854 100644
--- a/src/utils/os.h
+++ b/src/utils/os.h
@@ -247,6 +247,13 @@
int os_file_exists(const char *fname);
/**
+ * os_fsync - Sync a file's (for a given stream) state with storage device
+ * @stream: the stream to be flushed
+ * Returns: 0 if the operation succeeded or -1 on failure
+ */
+int os_fsync(FILE *stream);
+
+/**
* os_zalloc - Allocate and zero memory
* @size: Number of bytes to allocate
* Returns: Pointer to allocated and zeroed memory or %NULL on failure
diff --git a/src/utils/os_internal.c b/src/utils/os_internal.c
index 77733ad..b8fb2db 100644
--- a/src/utils/os_internal.c
+++ b/src/utils/os_internal.c
@@ -243,6 +243,12 @@
}
+int os_fsync(FILE *stream)
+{
+ return 0;
+}
+
+
void * os_zalloc(size_t size)
{
void *n = os_malloc(size);
diff --git a/src/utils/os_none.c b/src/utils/os_none.c
index 83fe025..96d243d 100644
--- a/src/utils/os_none.c
+++ b/src/utils/os_none.c
@@ -102,6 +102,12 @@
}
+int os_fsync(FILE *stream)
+{
+ return 0;
+}
+
+
void * os_zalloc(size_t size)
{
return NULL;
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c
index e0c1125..ac73f7a 100644
--- a/src/utils/os_unix.c
+++ b/src/utils/os_unix.c
@@ -415,6 +415,14 @@
}
+int os_fsync(FILE *stream)
+{
+ if (!fflush(stream))
+ return fsync(fileno(stream));
+ return -1;
+}
+
+
#ifndef WPA_TRACE
void * os_zalloc(size_t size)
{
diff --git a/src/utils/os_win32.c b/src/utils/os_win32.c
index 296ea13..890abf4 100644
--- a/src/utils/os_win32.c
+++ b/src/utils/os_win32.c
@@ -216,6 +216,24 @@
}
+int os_fsync(FILE *stream)
+{
+ HANDLE hFile;
+
+ if (stream == NULL)
+ return -1;
+
+ hFile = _get_osfhandle(_fileno(stream));
+ if (hFile == INVALID_HANDLE_VALUE)
+ return -1;
+
+ if (!FlushFileBuffers(hFile))
+ return -1;
+
+ return 0;
+}
+
+
void * os_zalloc(size_t size)
{
return calloc(1, size);
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index ae34f10..aeea70c 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1353,6 +1353,8 @@
}
#endif /* CONFIG_NO_CONFIG_BLOBS */
+ os_fsync(f);
+
fclose(f);
if (tmp_name) {