diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-04-02 01:32:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-04-02 01:32:46 +0000 |
commit | 15fc29c820c8879c604f19181fdfe62104d98a9d (patch) | |
tree | 7a674d1fad4045f52aa37fd192ad529198d40956 /packet-ypbind.c | |
parent | 49de302c8468bef63e38d6683e836abc6ea9ab5f (diff) |
Fix a bunch of bits of code that used "tvb_get_ntohl()" to fetch IP
addresses and then tried to compensate for that error using "htonl()"
(or didn't bother compensating, in some cases).
svn path=/trunk/; revision=5082
Diffstat (limited to 'packet-ypbind.c')
-rw-r--r-- | packet-ypbind.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/packet-ypbind.c b/packet-ypbind.c index febe377433..4a41cd798c 100644 --- a/packet-ypbind.c +++ b/packet-ypbind.c @@ -1,10 +1,10 @@ /* packet-ypbind.c * Routines for ypbind dissection * - * $Id: packet-ypbind.c,v 1.9 2002/01/05 21:49:36 guy Exp $ + * $Id: packet-ypbind.c,v 1.10 2002/04/02 01:32:46 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * * Copied from packet-smb.c @@ -82,7 +82,6 @@ static int dissect_ypbind_domain_v2_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { guint32 type; - guint32 tid; /* response type */ type=tvb_get_ntohl(tvb, offset); @@ -91,11 +90,8 @@ dissect_ypbind_domain_v2_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, pr switch(type){ case YPBIND_RESP_TYPE_SUCC_VAL: /* ip address */ - tid=tvb_get_ntohl(tvb,offset); - tid=((tid&0x000000ff)<<24)|((tid&0x0000ff00)<<8) - |((tid&0x00ff0000)>>8)|((tid&0xff000000)>>24); - proto_tree_add_ipv4(tree, hf_ypbind_addr, - tvb, offset, 4, tid); + proto_tree_add_item(tree, hf_ypbind_addr, + tvb, offset, 4, FALSE); offset += 4; /* port */ @@ -116,18 +112,13 @@ dissect_ypbind_domain_v2_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, pr static int dissect_ypbind_setdomain_v2_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - guint32 tid; - /* domain */ offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypbind_domain, offset, NULL); /* ip address */ - tid=tvb_get_ntohl(tvb,offset); - tid=((tid&0x000000ff)<<24)|((tid&0x0000ff00)<<8) - |((tid&0x00ff0000)>>8)|((tid&0xff000000)>>24); - proto_tree_add_ipv4(tree, hf_ypbind_addr, - tvb, offset, 4, tid); + proto_tree_add_item(tree, hf_ypbind_addr, + tvb, offset, 4, FALSE); offset += 4; /* port */ |