aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-03-04 09:43:58 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-04 09:43:58 (GMT)
commitfa07d2d463a5ea3442185b57e4fadc8fb3c83309 (patch)
tree0ea2f4916b644ca63928a91745c047b7b8d75dc7 /src
parentd4359923e1ea8bd618da51ce527f57c94b73c35b (diff)
downloadhostap-fa07d2d463a5ea3442185b57e4fadc8fb3c83309.zip
hostap-fa07d2d463a5ea3442185b57e4fadc8fb3c83309.tar.gz
hostap-fa07d2d463a5ea3442185b57e4fadc8fb3c83309.tar.bz2
tests: Add TEST_FAIL() checks in l2_packet
This enables additional test coverage for error paths. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/l2_packet/l2_packet_linux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/l2_packet/l2_packet_linux.c b/src/l2_packet/l2_packet_linux.c
index a7a300e..65b4906 100644
--- a/src/l2_packet/l2_packet_linux.c
+++ b/src/l2_packet/l2_packet_linux.c
@@ -96,6 +96,9 @@ int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto,
const u8 *buf, size_t len)
{
int ret;
+
+ if (TEST_FAIL())
+ return -1;
if (l2 == NULL)
return -1;
if (l2->l2_hdr) {
@@ -458,6 +461,9 @@ int l2_packet_set_packet_filter(struct l2_packet_data *l2,
{
const struct sock_fprog *sock_filter;
+ if (TEST_FAIL())
+ return -1;
+
switch (type) {
case L2_PACKET_FILTER_DHCP:
sock_filter = &dhcp_sock_filter;