From 6ceee05ad984b5abd108b32cc04ae5045166f51c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 27 Feb 2018 12:06:28 +0100 Subject: [PATCH] prog: extend a TODO about big-endian hints --- prog/hints.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prog/hints.go b/prog/hints.go index 9ea317cf..69ba6c6a 100644 --- a/prog/hints.go +++ b/prog/hints.go @@ -113,6 +113,10 @@ func checkConstArg(arg *ConstArg, compMap CompMap, exec func()) { func checkDataArg(arg *DataArg, compMap CompMap, exec func()) { // TODO(dvyukov): we need big-endian match for ANYBLOBs. + // TODO(dvyukov): any probably not just for ANYBLOBs. Consider that + // kernel code does not convert the data (i.e. not ntohs(pkt->proto) == ETH_P_BATMAN), + // but instead converts the constant (i.e. pkt->proto == htons(ETH_P_BATMAN)). + // In such case we will see dynamic operand that does not match what we have in the program. bytes := make([]byte, 8) data := arg.Data() size := len(data)