wpa_supplicant/scan.c
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)
{
	const u8 *end, *pos;

	pos = (const u8 *) (res + 1);
	end = pos + res->ie_len;

	while (end - pos > 1) {
		if (2 + pos[1] > end - pos)
			break;
		if (pos[0] == ie)
			return pos;
		pos += 2 + pos[1];
	}

	return NULL;
}
/**
 * wpa_scan_get_ie - Fetch a specified information element from a scan result
 * @res: Scan result entry
 * @ie: Information element identitifier (WLAN_EID_*)
 * Returns: Pointer to the information element (id field) or %NULL if not found
 *
 * This function returns the first matching information element in the scan
 * result.
 */
Fetch a specified information element from a scan result
@res: Scan result entry
@ie: Information element identitifier (WLAN_EID_*)
Returns: Pointer to the information element (id field) or %NULL if not found

This function returns the first matching information element in the scan
result.
Fetch a specified information element from a scan result @res : Scan result entry @ie : Information element identitifier ( WLAN_EID_ * ) Returns : Pointer to the information element ( id field ) or %NULL if not found This function returns the first matching information element in the scan result .
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)
{
	const u8 *end, *pos;
	pos = (const u8 *) (res + 1);
	end = pos + res->ie_len;
	while (end - pos > 1) {
		if (2 + pos[1] > end - pos)
			break;
		if (pos[0] == ie)
			return pos;
		pos += 2 + pos[1];
	}
	return NULL;
}
const u8 * wpa_scan_get_ie ( const struct wpa_scan_res * res , u8 ie ) { const u8 * end , * pos ; pos = ( const u8 * ) ( res + 1 ) ; end = pos + res -> ie_len ; while ( end - pos > 1 ) { if ( 2 + pos [ 1 ] > end - pos ) break ; if ( pos [ 0 ] == ie ) return pos ; pos += 2 + pos [ 1 ] ; } return NULL ; }
wpa_scan_get_ie - Fetch a specified information element from a scan result
 @res: Scan result entry
 @ie: Information element identitifier (WLAN_EID_*)
 Returns: Pointer to the information element (id field) or %NULL if not found
wpa_scan_get_ie - Fetch a specified information element from a scan result @res : Scan result entry @ie : Information element identitifier ( WLAN_EID_ * ) Returns : Pointer to the information element ( id field ) or %NULL if not found