summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuyang Huang <yuyanghuang@google.com>2024-02-20 19:09:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-02-20 19:09:59 +0000
commit85786ffacd06015af5b5614776166c854d103f71 (patch)
tree8d9e0f08c8c3d92657faa18e02c2116a302b5ecf
parentd199c796d8d4941c18664082b300ff3267080f54 (diff)
parent82e41db69beaa95862b0edf280cfcc6a7521d706 (diff)
downloadapf-85786ffacd06015af5b5614776166c854d103f71.tar.gz
v5: trigger transmit failure in the test_buf_allocator am: 82e41db69b
Original change: https://android-review.googlesource.com/c/platform/hardware/google/apf/+/2968343 Change-Id: I58c3859dee33b67e4760cee640affb424c86d942 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--v5/test_buf_allocator.c1
-rw-r--r--v5/test_buf_allocator.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/v5/test_buf_allocator.c b/v5/test_buf_allocator.c
index 3fec1f5..e30815e 100644
--- a/v5/test_buf_allocator.c
+++ b/v5/test_buf_allocator.c
@@ -42,6 +42,7 @@ uint8_t* apf_allocate_buffer(__attribute__ ((unused)) void* ctx, uint32_t size)
*/
int apf_transmit_buffer(__attribute__((unused)) void* ctx, uint8_t* ptr,
uint32_t len, uint8_t dscp) {
+ if (len && len < ETH_HLEN) return -1;
if (ptr != apf_test_buffer) return -1;
apf_test_tx_packet_len = len;
apf_test_tx_dscp = dscp;
diff --git a/v5/test_buf_allocator.h b/v5/test_buf_allocator.h
index a03a2cc..c5fa5c4 100644
--- a/v5/test_buf_allocator.h
+++ b/v5/test_buf_allocator.h
@@ -18,6 +18,7 @@
#define TEST_BUF_ALLOCATOR
#include <stdint.h>
+#include <linux/if_ether.h>
extern uint8_t apf_test_buffer[1514];
extern uint32_t apf_test_tx_packet_len;