summaryrefslogtreecommitdiff
path: root/gencode.c
diff options
context:
space:
mode:
authorguy <guy>2005-05-01 09:17:45 +0000
committerguy <guy>2005-05-01 09:17:45 +0000
commitbd90260840decf3d52fe683166b493990c6b3eda (patch)
tree933166be00919c149f4a7a16aed8cfde851c73f2 /gencode.c
parent94f7e7a5ede1421636178599a25fd68d5ae4e6a8 (diff)
downloadlibpcap-bd90260840decf3d52fe683166b493990c6b3eda.tar.gz
Use "gen_load_ipxhdrlen()" in more places.
Diffstat (limited to 'gencode.c')
-rw-r--r--gencode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gencode.c b/gencode.c
index 6a4ee639..5f82f16b 100644
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.239 2005-05-01 09:05:01 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.240 2005-05-01 09:17:45 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -1104,7 +1104,7 @@ gen_load_a(offrel, offset, size)
enum e_offrel offrel;
u_int offset, size;
{
- struct slist *s;
+ struct slist *s, *s2;
switch (offrel) {
@@ -1128,15 +1128,15 @@ gen_load_a(offrel, offset, size)
* Load the X register with the length of the IPv4 header,
* in bytes.
*/
- s = new_stmt(BPF_LDX|BPF_MSH|BPF_B);
- s->s.k = off_nl;
+ s = gen_loadx_iphdrlen();
/*
* Load the item at {length of the link-layer header} +
* {length of the IPv4 header} + {specified offset}.
*/
- s->next = new_stmt(BPF_LD|BPF_IND|size);
- s->next->s.k = off_nl + offset;
+ s2 = new_stmt(BPF_LD|BPF_IND|size);
+ s2->s.k = off_nl + offset;
+ sappend(s, s2);
break;
case OR_TRAN_IPV6: