summaryrefslogtreecommitdiff
path: root/usr.sbin/pppoe
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-04-15 20:41:47 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-04-15 20:41:47 +0000
commita5ae2a6465d5d644bf440cd1ff64ef1c7a580d1c (patch)
tree5335de307daf3f11b043757c6c88a4de2469a872 /usr.sbin/pppoe
parent5023a93efffabbc25019631d2e1b495d80cec676 (diff)
Fix several errors in the bpf program; bugs reported by
Russell T Hunt <alaric@MIT.EDU>.
Diffstat (limited to 'usr.sbin/pppoe')
-rw-r--r--usr.sbin/pppoe/pppoe.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/pppoe/pppoe.c b/usr.sbin/pppoe/pppoe.c
index 5c5a3e5677a..015346f2d73 100644
--- a/usr.sbin/pppoe/pppoe.c
+++ b/usr.sbin/pppoe/pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppoe.c,v 1.3 2001/02/18 22:52:53 miod Exp $ */
+/* $OpenBSD: pppoe.c,v 1.4 2001/04/15 20:41:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -186,7 +186,7 @@ setupfilter(ifn, ea, server_mode)
idx++;
insns[idx].code = BPF_JMP | BPF_JEQ | BPF_K;
- insns[idx].k = ep[4] << 8 | ep[5];
+ insns[idx].k = (ep[4] << 8) | (ep[5] << 0);
insns[idx].jt = 0;
insns[idx].jf = 1;
idx++;
@@ -223,7 +223,8 @@ setupfilter(ifn, ea, server_mode)
idx++;
insns[idx].code = BPF_JMP | BPF_JEQ | BPF_K;
- insns[idx].k = (ep[0]) | (ep[1] << 8) | (ep[3] << 16) | (ep[3] << 24);
+ insns[idx].k =
+ (ep[0] << 24) | (ep[1] << 16) | (ep[2] << 8) | (ep[3] << 0);
insns[idx].jt = 0;
insns[idx].jf = 3;
idx++;
@@ -234,7 +235,7 @@ setupfilter(ifn, ea, server_mode)
idx++;
insns[idx].code = BPF_JMP | BPF_JEQ | BPF_K;
- insns[idx].k = (ep[4]) | (ep[5] << 8);
+ insns[idx].k = (ep[4] << 8) | (ep[5] << 0);
insns[idx].jt = 0;
insns[idx].jf = 1;
idx++;
@@ -245,9 +246,7 @@ setupfilter(ifn, ea, server_mode)
idx++;
insns[idx].code = BPF_RET | BPF_K;
- insns[idx].k = (u_int)-1;
- insns[idx].jt = 0;
- insns[idx].jf = 0;
+ insns[idx].k = insns[idx].jt = insns[idx].jf = 0;
idx++;
filter.bf_len = idx;