netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: bpf_dbg: register misuse
@ 2014-04-25 20:52 Brendan Hickey
  2014-04-25 21:15 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Brendan Hickey @ 2014-04-25 20:52 UTC (permalink / raw)
  To: netdev; +Cc: dborkman

Hi,

I noticed a mistaken use of the X register instead of the K register
in bpf_dbg. Enclosed is a fix.

Brendan


From: Brendan Hickey <bhickey@google.com>
Date: Fri, 25 Apr 2014 15:54:13 -0400
Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND

The AND instruction is erroneously using the X register instead of the K
register.
---
 tools/net/bpf_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
index 65dc757..5e54848 100644
--- a/tools/net/bpf_dbg.c
+++ b/tools/net/bpf_dbg.c
@@ -823,7 +823,7 @@ do_div:
  r->A &= r->X;
  break;
  case BPF_ALU_AND | BPF_K:
- r->A &= r->X;
+ r->A &= K;
  break;
  case BPF_ALU_OR | BPF_X:
  r->A |= r->X;


--
1.9.1.423.g4596e3a

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-28  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 20:52 [PATCH] tools: bpf_dbg: register misuse Brendan Hickey
2014-04-25 21:15 ` Alexei Starovoitov
2014-04-25 21:23   ` Brendan Hickey
2014-04-28  8:49     ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).