aboutsummaryrefslogtreecommitdiffstats
path: root/packet-vj.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-14 23:22:22 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-14 23:22:22 +0000
commit64fe90a383556123695cd9895b88f47a3df85f71 (patch)
tree64d0561f883974b6cc1a30309a5f9444292a89d9 /packet-vj.c
parentdb319329411e4b1db7e19e8cc5eb518525d107ad (diff)
From Joerg Mayer: get rid of some unused variables and arguments.
Use "tvb_get_ntohs()" to fetch the checksum from a VJ compressed packet, rather than doing the ntoh by hand. svn path=/trunk/; revision=5163
Diffstat (limited to 'packet-vj.c')
-rw-r--r--packet-vj.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/packet-vj.c b/packet-vj.c
index ec3aa2ebd8..78da877fcf 100644
--- a/packet-vj.c
+++ b/packet-vj.c
@@ -1,7 +1,7 @@
/* packet-vj.c
* Routines for Van Jacobson header decompression.
*
- * $Id: packet-vj.c,v 1.6 2002/02/18 01:08:37 guy Exp $
+ * $Id: packet-vj.c,v 1.7 2002/04/14 23:22:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -350,7 +350,6 @@ vjc_tvb_setup(tvbuff_t *src_tvb,
tvbuff_t **dst_tvb,
frame_data * fd)
{
- tvbuff_t *orig_tvb = NULL;
vj_header_t *hdr_buf;
guint8 *data_ptr;
guint8 *pbuf = NULL;
@@ -408,8 +407,8 @@ vjc_update_state(tvbuff_t *src_tvb, slcompress *comp, frame_data *fd)
/* Build TCP and IP headers */
hdrlen = lo_nibble(ip->ihl_version) * 4 + TCP_OFFSET(thp) * 4;
- thp->cksum = htons((tvb_get_guint8(src_tvb, offset++) << 8) |
- tvb_get_guint8(src_tvb, offset++));
+ thp->cksum = htons(tvb_get_ntohs(src_tvb, offset));
+ offset += 2;
if (changes & CHANGE_PUSH_BIT)
thp->flags |= TCP_PUSH_BIT;
else
@@ -578,11 +577,8 @@ vjuc_tvb_setup(tvbuff_t *tvb,
frame_data *fd)
{
guint8 ihl = ZERO;
- guint8 index = ZERO;
gint isize = tvb_length(tvb);
guint8 *buffer = NULL;
- tvbuff_t *orig_tvb = NULL;
- gint orig_offset = 0;
g_assert(comp);
g_assert(tvb);
@@ -619,7 +615,6 @@ vjuc_update_state(tvbuff_t *tvb, slcompress *comp, guint8 index)
{
cstate *cs = NULL;
guint8 ihl = ZERO;
- gint isize = tvb_length(tvb);
g_assert(comp);
g_assert(tvb);