Index: head/security/wpa_supplicant/Makefile =================================================================== --- head/security/wpa_supplicant/Makefile (revision 399107) +++ head/security/wpa_supplicant/Makefile (revision 399108) @@ -1,163 +1,162 @@ # $FreeBSD$ PORTNAME= wpa_supplicant -PORTVERSION= 2.4 -PORTREVISION= 4 +PORTVERSION= 2.5 CATEGORIES= security net MASTER_SITES= http://w1.fi/releases/ MAINTAINER= marino@FreeBSD.org COMMENT= Supplicant (client) for WPA/802.1x protocols USES= cpe gmake readline USE_OPENSSL= yes BUILD_WRKSRC= ${WRKSRC}/wpa_supplicant INSTALL_WRKSRC= ${WRKSRC}/src CFLAGS+= ${CPPFLAGS} # USES=readline only augments CPPFLAGS and LDFLAGS -LDFLAGS= -lutil +LDFLAGS+= -lutil SUB_FILES= pkg-message PORTDOCS= README ChangeLog CFG= ${BUILD_WRKSRC}/.config OPTIONS_MULTI= DRV EAP OPTIONS_MULTI_DRV= BSD WIRED NDIS TEST NONE #ROBOSWITCH OPTIONS_MULTI_EAP= TLS PEAP TTLS MD5 MSCHAPv2 GTC LEAP OTP PSK FAST \ SIM PWD PAX AKA AKA_PRIME SAKE GPSK TNC IKEv2 EKE OPTIONS_DEFINE= WPS WPS_ER WPS_NOREG WPS_NFC PKCS12 SMARTCARD \ HT_OVERRIDES VHT_OVERRIDES TLSV12 IEEE80211W \ IEEE80211R DEBUG_FILE DEBUG_SYSLOG PRIVSEP \ DELAYED_MIC IEEE80211N IEEE80211AC INTERWORKING \ HS20 NO_ROAMING P2P TDLS OPTIONS_DEFAULT= BSD WIRED NDIS \ TLS PEAP TTLS MD5 MSCHAPv2 GTC LEAP OTP PSK \ WPS PKCS12 SMARTCARD IEEE80211R DEBUG_SYSLOG \ INTERWORKING HS20 WPS_DESC= Wi-Fi Protected Setup WPS_ER_DESC= Enable WPS External Registrar WPS_NOREG_DESC= Disable open network credentials when registrar WPS_NFC_DESC= Near Field Communication (NFC) configuration PKCS12_DESC= PKCS\#12 (PFS) support SMARTCARD_DESC= Private key on smartcard support HT_OVERRIDES_DESC= Disable HT/HT40, mask MCS rates, etc VHT_OVERRIDES_DESC= Disable VHT, mask MCS rates, etc TLSV12_DESC= Build with TLS v1.2 instead of TLS v1.0 IEEE80211AC_DESC= Very High Throughput, AP mode (IEEE 802.11ac) IEEE80211N_DESC= High Throughput, AP mode (IEEE 802.11n) IEEE80211R_DESC= Fast BSS Transition (IEEE 802.11r-2008) IEEE80211W_DESC= Management Frame Protection (IEEE 802.11w) DEBUG_FILE_DESC= Support for writing debug log to a file DEBUG_SYSLOG_DESC= Send debug messages to syslog instead of stdout PRIVSEP_DESC= Privilege separation DELAYED_MIC_DESC= Mitigate TKIP attack, random delay on MIC errors INTERWORKING_DESC= Improve ext. network interworking (IEEE 802.11u) HS20_DESC= Hotspot 2.0 NO_ROAMING_DESC= Disable roaming P2P_DESC= Peer-to-Peer support TDLS_DESC= Tunneled Direct Link Setup DRV_DESC= Driver options BSD_DESC= BSD net80211 interface NDIS_DESC= Windows NDIS interface WIRED_DESC= Wired ethernet interface ROBOSWITCH_DESC= Broadcom Roboswitch interface TEST_DESC= Development testing interface NONE_DESC= The 'no driver' interface, e.g. WPS ER only EAP_DESC= Extensible Authentication Protocols TLS_DESC= Transport Layer Security PEAP_DESC= Protected Extensible Authentication Protocol TTLS_DESC= Tunneled Transport Layer Security MD5_DESC= MD5 hash (deprecated, no key generation) MSCHAPv2_DESC= Microsoft CHAP version 2 (RFC 2759) GTC_DESC= Generic Token Card LEAP_DESC= Lightweight Extensible Authentication Protocol OTP_DESC= One-Time Password PSK_DESC= Pre-Shared key FAST_DESC= Flexible Authentication via Secure Tunneling AKA_DESC= Autentication and Key Agreement (UMTS) AKA_PRIME_DESC= AKA Prime variant (RFC 5448) EKE_DESC= Encrypted Key Exchange SIM_DESC= Subscriber Identity Module IKEv2_DESC= Internet Key Exchange version 2 PWD_DESC= Shared password (RFC 5931) PAX_DESC= Password Authenticated Exchange SAKE_DESC= Shared-Secret Authentication & Key Establishment GPSK_DESC= Generalized Pre-Shared Key TNC_DESC= Trusted Network Connect .include .if ${PORT_OPTIONS:MSIM} || ${PORT_OPTIONS:MAKA} || ${PORT_OPTIONS:MAKA_PRIME} LIB_DEPENDS+= libpcsclite.so:${PORTSDIR}/devel/pcsc-lite CFLAGS+= -I${LOCALBASE}/include/PCSC LDFLAGS+= -L${LOCALBASE}/lib .endif .if ${PORT_OPTIONS:MPRIVSEP} PLIST_FILES+= sbin/wpa_priv .endif post-patch: ${CP} ${FILESDIR}/Packet32.[ch] ${FILESDIR}/ntddndis.h \ ${WRKSRC}/src/utils # Set driver(s) .for item in BSD NDIS WIRED ROBOSWITCH TEST NONE . if ${PORT_OPTIONS:M${item}} @${ECHO} CONFIG_DRIVER_${item}=y >> ${CFG} . endif .endfor # Set EAP protocol(s) .for item in MD5 MSCHAPv2 TLS PEAP TTLS FAST GTC OTP PSK PWD PAX LEAP SIM \ AKA AKA_PRIME SAKE GPSK TNC IKEv2 EKE . if ${PORT_OPTIONS:M${item}} @${ECHO} CONFIG_EAP_${item:tu}=y >> ${CFG} . endif .endfor .if ${PORT_OPTIONS:MSIM} || ${PORT_OPTIONS:MAKA} || ${PORT_OPTIONS:MAKA_PRIME} @${ECHO} CONFIG_PCSC=y >> ${CFG} .endif .for simple in WPS WPS_ER WPS_NFC PKCS12 SMARTCARD HT_OVERRIDES \ VHT_OVERRIDES TLSV12 IEEE80211AC IEEE80211N IEEE80211R IEEE80211W \ INTERWORKING DEBUG_FILE DEBUG_SYSLOG HS20 NO_ROAMING PRIVSEP P2P TDLS . if ${PORT_OPTIONS:M${simple}} @${ECHO} CONFIG_${simple}=y >> ${CFG} . endif .endfor .for item in READLINE PEERKEY @${ECHO} CONFIG_${item}=y >> ${CFG} .endfor .if ${PORT_OPTIONS:MIEEE80211AC} || ${PORT_OPTIONS:MIEEE80211N} @${ECHO} CONFIG_AP=y >> ${CFG} .endif .if ${PORT_OPTIONS:MGPSK} # GPSK desired, assume highest SHA desired too @${ECHO} CONFIG_EAP_GPSK_SHA256=y >> ${CFG} .endif .if ${PORT_OPTIONS:MWPS_NOREG} @${ECHO} CONFIG_WPS_REG_DISABLE_OPEN=y >> ${CFG} .endif .if ${PORT_OPTIONS:MDELAYED_MIC} @${ECHO} CONFIG_DELAYED_MIC_ERROR_REPORT=y >> ${CFG} .endif @${ECHO} CONFIG_OS=unix >> ${CFG} @${ECHO} CONFIG_CTRL_IFACE=unix >> ${CFG} @${ECHO} CONFIG_BACKEND=file >> ${CFG} @${ECHO} CONFIG_L2_PACKET=freebsd >> ${CFG} @${ECHO} CONFIG_TLS=openssl >> ${CFG} do-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${BUILD_WRKSRC} && ${INSTALL_PROGRAM} wpa_supplicant wpa_cli \ wpa_passphrase ${STAGEDIR}${PREFIX}/sbin) .if ${PORT_OPTIONS:MPRIVSEP} ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/wpa_priv ${STAGEDIR}${PREFIX}/sbin .endif ${INSTALL_DATA} ${BUILD_WRKSRC}/wpa_supplicant.conf \ ${STAGEDIR}${PREFIX}/etc/wpa_supplicant.conf.sample (cd ${BUILD_WRKSRC} && \ ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}) .include Index: head/security/wpa_supplicant/distinfo =================================================================== --- head/security/wpa_supplicant/distinfo (revision 399107) +++ head/security/wpa_supplicant/distinfo (revision 399108) @@ -1,2 +1,2 @@ -SHA256 (wpa_supplicant-2.4.tar.gz) = 058dc832c096139a059e6df814080f50251a8d313c21b13364c54a1e70109122 -SIZE (wpa_supplicant-2.4.tar.gz) = 2525648 +SHA256 (wpa_supplicant-2.5.tar.gz) = cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316 +SIZE (wpa_supplicant-2.5.tar.gz) = 2607336 Index: head/security/wpa_supplicant/files/patch-src_ap_wmm.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_ap_wmm.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_ap_wmm.c (nonexistent) @@ -1,12 +0,0 @@ ---- src/ap/wmm.c.orig 2015-03-15 17:30:39 UTC -+++ src/ap/wmm.c -@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_d - return; - } - -+ if (left < 0) -+ return; /* not a valid WMM Action frame */ -+ - /* extract the tspec info element */ - if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { - hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, Property changes on: head/security/wpa_supplicant/files/patch-src_ap_wmm.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_eap__peer_eap__pwd.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_eap__peer_eap__pwd.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_eap__peer_eap__pwd.c (nonexistent) @@ -1,77 +0,0 @@ ---- src/eap_peer/eap_pwd.c.orig 2015-03-15 17:30:39 UTC -+++ src/eap_peer/eap_pwd.c -@@ -301,6 +301,23 @@ eap_pwd_perform_commit_exchange(struct e - BIGNUM *mask = NULL, *x = NULL, *y = NULL, *cofactor = NULL; - u16 offset; - u8 *ptr, *scalar = NULL, *element = NULL; -+ size_t prime_len, order_len; -+ -+ if (data->state != PWD_Commit_Req) { -+ ret->ignore = TRUE; -+ goto fin; -+ } -+ -+ prime_len = BN_num_bytes(data->grp->prime); -+ order_len = BN_num_bytes(data->grp->order); -+ -+ if (payload_len != 2 * prime_len + order_len) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Commit payload length %u (expected %u)", -+ (unsigned int) payload_len, -+ (unsigned int) (2 * prime_len + order_len)); -+ goto fin; -+ } - - if (((data->private_value = BN_new()) == NULL) || - ((data->my_element = EC_POINT_new(data->grp->group)) == NULL) || -@@ -500,6 +517,18 @@ eap_pwd_perform_confirm_exchange(struct - u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; - int offset; - -+ if (data->state != PWD_Confirm_Req) { -+ ret->ignore = TRUE; -+ goto fin; -+ } -+ -+ if (payload_len != SHA256_MAC_LEN) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", -+ (unsigned int) payload_len, SHA256_MAC_LEN); -+ goto fin; -+ } -+ - /* - * first build up the ciphersuite which is group | random_function | - * prf -@@ -783,11 +812,23 @@ eap_pwd_process(struct eap_sm *sm, void - * if it's the first fragment there'll be a length field - */ - if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { -+ if (len < 2) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Frame too short to contain Total-Length field"); -+ ret->ignore = TRUE; -+ return NULL; -+ } - tot_len = WPA_GET_BE16(pos); - wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments whose " - "total length = %d", tot_len); - if (tot_len > 15000) - return NULL; -+ if (data->inbuf) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); -+ ret->ignore = TRUE; -+ return NULL; -+ } - data->inbuf = wpabuf_alloc(tot_len); - if (data->inbuf == NULL) { - wpa_printf(MSG_INFO, "Out of memory to buffer " -@@ -873,6 +914,7 @@ eap_pwd_process(struct eap_sm *sm, void - /* - * we have output! Do we need to fragment it? - */ -+ lm_exch = EAP_PWD_GET_EXCHANGE(lm_exch); - len = wpabuf_len(data->outbuf); - if ((len + EAP_PWD_HDR_SIZE) > data->mtu) { - resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_PWD, data->mtu, Property changes on: head/security/wpa_supplicant/files/patch-src_eap__peer_eap__pwd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_wps_ndef.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_wps_ndef.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_wps_ndef.c (nonexistent) @@ -1,21 +0,0 @@ ---- src/wps/ndef.c.orig 2015-03-15 17:30:39 UTC -+++ src/wps/ndef.c -@@ -48,6 +48,8 @@ static int ndef_parse_record(const u8 *d - if (size < 6) - return -1; - record->payload_length = ntohl(*(u32 *)pos); -+ if (record->payload_length > size - 6) -+ return -1; - pos += sizeof(u32); - } - -@@ -68,7 +70,8 @@ static int ndef_parse_record(const u8 *d - pos += record->payload_length; - - record->total_length = pos - data; -- if (record->total_length > size) -+ if (record->total_length > size || -+ record->total_length < record->payload_length) - return -1; - return 0; - } Property changes on: head/security/wpa_supplicant/files/patch-src_wps_ndef.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_p2p_p2p.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_p2p_p2p.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_p2p_p2p.c (nonexistent) @@ -1,10 +0,0 @@ ---- src/p2p/p2p.c.orig 2015-04-24 22:44:26 UTC -+++ src/p2p/p2p.c -@@ -778,6 +778,7 @@ int p2p_add_device(struct p2p_data *p2p, - if (os_memcmp(addr, p2p_dev_addr, ETH_ALEN) != 0) - os_memcpy(dev->interface_addr, addr, ETH_ALEN); - if (msg.ssid && -+ msg.ssid[1] <= sizeof(dev->oper_ssid) && - (msg.ssid[1] != P2P_WILDCARD_SSID_LEN || - os_memcmp(msg.ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) - != 0)) { Property changes on: head/security/wpa_supplicant/files/patch-src_p2p_p2p.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_eap__server_eap__server__pwd.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_eap__server_eap__server__pwd.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_eap__server_eap__server__pwd.c (nonexistent) @@ -1,60 +0,0 @@ ---- src/eap_server/eap_server_pwd.c.orig 2015-03-15 17:30:39 UTC -+++ src/eap_server/eap_server_pwd.c -@@ -634,9 +634,21 @@ eap_pwd_process_commit_resp(struct eap_s - BIGNUM *x = NULL, *y = NULL, *cofactor = NULL; - EC_POINT *K = NULL, *point = NULL; - int res = 0; -+ size_t prime_len, order_len; - - wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response"); - -+ prime_len = BN_num_bytes(data->grp->prime); -+ order_len = BN_num_bytes(data->grp->order); -+ -+ if (payload_len != 2 * prime_len + order_len) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Commit payload length %u (expected %u)", -+ (unsigned int) payload_len, -+ (unsigned int) (2 * prime_len + order_len)); -+ goto fin; -+ } -+ - if (((data->peer_scalar = BN_new()) == NULL) || - ((data->k = BN_new()) == NULL) || - ((cofactor = BN_new()) == NULL) || -@@ -752,6 +764,13 @@ eap_pwd_process_confirm_resp(struct eap_ - u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; - int offset; - -+ if (payload_len != SHA256_MAC_LEN) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", -+ (unsigned int) payload_len, SHA256_MAC_LEN); -+ goto fin; -+ } -+ - /* build up the ciphersuite: group | random_function | prf */ - grp = htons(data->group_num); - ptr = (u8 *) &cs; -@@ -901,11 +920,21 @@ static void eap_pwd_process(struct eap_s - * the first fragment has a total length - */ - if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { -+ if (len < 2) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Frame too short to contain Total-Length field"); -+ return; -+ } - tot_len = WPA_GET_BE16(pos); - wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments, total " - "length = %d", tot_len); - if (tot_len > 15000) - return; -+ if (data->inbuf) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); -+ return; -+ } - data->inbuf = wpabuf_alloc(tot_len); - if (data->inbuf == NULL) { - wpa_printf(MSG_INFO, "EAP-pwd: Out of memory to " Property changes on: head/security/wpa_supplicant/files/patch-src_eap__server_eap__server__pwd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_wps_httpread.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_wps_httpread.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_wps_httpread.c (nonexistent) @@ -1,16 +0,0 @@ ---- src/wps/httpread.c.orig 2015-03-15 17:30:39 UTC -+++ src/wps/httpread.c -@@ -533,6 +533,13 @@ static void httpread_read_handler(int sd - if (!isxdigit(*cbp)) - goto bad; - h->chunk_size = strtoul(cbp, NULL, 16); -+ if (h->chunk_size < 0 || -+ h->chunk_size > h->max_bytes) { -+ wpa_printf(MSG_DEBUG, -+ "httpread: Invalid chunk size %d", -+ h->chunk_size); -+ goto bad; -+ } - /* throw away chunk header - * so we have only real data - */ Property changes on: head/security/wpa_supplicant/files/patch-src_wps_httpread.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/wpa_supplicant/files/patch-src_utils_os__unix.c =================================================================== --- head/security/wpa_supplicant/files/patch-src_utils_os__unix.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-src_utils_os__unix.c (revision 399108) @@ -1,62 +1,73 @@ ---- src/utils/os_unix.c.orig 2015-03-15 17:30:39 UTC +--- src/utils/os_unix.c.orig 2015-09-27 19:02:05 UTC +++ src/utils/os_unix.c -@@ -190,17 +190,42 @@ static int os_daemon(int nochdir, int no +@@ -214,17 +214,42 @@ static int os_daemon(int nochdir, int no #define os_daemon daemon #endif /* __APPLE__ */ +#if defined(__FreeBSD__) || defined(__DragonFly__) +#define FREE_DRAGON +#include +#include +#include +#endif /* __FreeBSD__ || __DragonFly__ */ int os_daemonize(const char *pid_file) { #if defined(__uClinux__) || defined(__sun__) return -1; #else /* defined(__uClinux__) || defined(__sun__) */ +#ifdef FREE_DRAGON + pid_t otherpid; + struct pidfh *pfh; + + pfh = pidfile_open(pid_file, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(1, "Daemon already running, pid: %jd.", + (intmax_t)otherpid); + } + warn("Cannot open or create pidfile."); + } +#endif /* FREE_DRAGON */ if (os_daemon(0, 0)) { perror("daemon"); +#ifdef FREE_DRAGON + pidfile_remove(pfh); +#endif /* FREE_DRAGON */ return -1; } +#ifdef FREE_DRAGON + pidfile_write(pfh); +#else if (pid_file) { FILE *f = fopen(pid_file, "w"); if (f) { -@@ -208,6 +233,7 @@ int os_daemonize(const char *pid_file) +@@ -232,6 +257,7 @@ int os_daemonize(const char *pid_file) fclose(f); } } +#endif /* FREE_DRAGON */ return -0; #endif /* defined(__uClinux__) || defined(__sun__) */ -@@ -357,7 +383,7 @@ int os_setenv(const char *name, const ch +@@ -384,7 +410,7 @@ int os_setenv(const char *name, const ch int os_unsetenv(const char *name) { -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || \ +#if defined(FREE_DRAGON) || defined(__NetBSD__) || defined(__APPLE__) || \ defined(__OpenBSD__) unsetenv(name); return 0; +@@ -445,7 +471,9 @@ int os_file_exists(const char *fname) + int os_fdatasync(FILE *stream) + { + if (!fflush(stream)) { +-#ifndef __MACH__ ++#ifdef FREE_DRAGON ++ return fsync(fileno(stream)); ++#elif !defined __MACH__ + return fdatasync(fileno(stream)); + #else /* __MACH__ */ + #ifdef F_FULLFSYNC Index: head/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c =================================================================== --- head/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c (revision 399107) +++ head/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c (revision 399108) @@ -1,32 +1,32 @@ ---- wpa_supplicant/scan.c.orig 2015-03-15 17:30:39 UTC +--- wpa_supplicant/scan.c.orig 2015-09-27 19:02:05 UTC +++ wpa_supplicant/scan.c -@@ -1621,7 +1621,7 @@ struct wpabuf * wpa_scan_get_vendor_ie_m +@@ -1657,7 +1657,7 @@ struct wpabuf * wpa_scan_get_vendor_ie_m * better. */ static int wpa_scan_result_compar(const void *a, const void *b) { -#define MIN(a,b) a < b ? a : b +#define MINAB(a,b) a < b ? a : b struct wpa_scan_res **_wa = (void *) a; struct wpa_scan_res **_wb = (void *) b; struct wpa_scan_res *wa = *_wa; -@@ -1650,9 +1650,9 @@ static int wpa_scan_result_compar(const +@@ -1686,9 +1686,9 @@ static int wpa_scan_result_compar(const if (wa->flags & wb->flags & WPA_SCAN_LEVEL_DBM) { snr_a_full = wa->snr; - snr_a = MIN(wa->snr, GREAT_SNR); + snr_a = MINAB(wa->snr, GREAT_SNR); snr_b_full = wb->snr; -- snr_b = MIN(wa->snr, GREAT_SNR); -+ snr_b = MINAB(wa->snr, GREAT_SNR); +- snr_b = MIN(wb->snr, GREAT_SNR); ++ snr_b = MINAB(wb->snr, GREAT_SNR); } else { /* Level is not in dBm, so we can't calculate * SNR. Just use raw level (units unknown). */ -@@ -1675,7 +1675,7 @@ static int wpa_scan_result_compar(const +@@ -1711,7 +1711,7 @@ static int wpa_scan_result_compar(const if (snr_b_full == snr_a_full) return wb->qual - wa->qual; return snr_b_full - snr_a_full; -#undef MIN +#undef MINAB }