ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] patch for packet-dhcpv6.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sun, 15 Aug 2004 23:30:39 -0700
Muhammad Muquit wrote:

The patch is against ethereal 0.10.6 pre-release

It's not a patch, it's a completely new version of packet-dhcpv6.c. It's best to submit changes as patches, rather than as new versions of source files, so that if the source file has changed since you made your changes, the changes can still be fairly easily applied.

* In OPTION_DOMAIN_LIST (24), DNS domains will be shown as decoded domains
  instead of showing them as encoded bytes.

* Code is added to support a new option OPTION_CLIENT_FQDN as defined
  in the IETF draft "draft-volz-dhc-dhcpv6-fqdn-00.txt".  As the option code
  is not assigned yet, I used the next number 42 for unassinged codes.

Note that there's a routine, "get_dns_name()", in "epan/dissectors/packet-dns.c" that handles decoding of RFC 1035-encoded domain names; you should probably use that, rather than writing your own code to decode them. (Note that "get_dns_name()" checks for loops in the encoding.)


* There were two checks at the beginning of dhcpv6_option(), which cause
  infinite loop if a packet is little bit out of ordinary. I commented
  them out for the time being. They are inside #if 0 right now. Please fix
  them who understands the code well. I don't have time to figure out the
  code right now, sorry.

I've checked in changes to make sure all callers of "dhcpv6_option()" check the "at_end" flag, and stop looping over the options if it's true.

TODO:
    - error messages are written to stderr. change them for GUI.

If the error messages are due to invalid packets, the errors should be put into the protocol tree (note that dissectors are *NOT* compiled differently depending on whether they're in Ethereal or Tethereal!).

However, if you use "get_dns_name()", it should take care of most if not all of those errors.