aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-22Improve name resolution preference tooltips.Jaap Keuter1-15/+12
Change the tooltips texts to make them better describe the preference. Bug: 13130 Bug: 13131 Change-Id: Ie753e3703a702bdafed91cf0f41b306347088526 Reviewed-on: https://code.wireshark.org/review/18878 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-16Resolv: various code / comment cleanupsJaap Keuter1-53/+39
Various cleanups and corrections regarding MAC address handling. Change-Id: I31e2e377bc1c73705a89517c776d51bbb19b9ce3 Reviewed-on: https://code.wireshark.org/review/18836 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-11-12Really return manufacturer name if it's known.Jaap Keuter1-2/+2
Bug: 13126 Change-Id: I56e935cea7aa323941ac612d4954875a01910684 Reviewed-on: https://code.wireshark.org/review/18752 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-20Put the SS7 PC name resolution feature in the release notes.Jeff Morriss1-1/+1
Fix the casing of the preference while at it (it now matches other name resolution preferences). Change-Id: Ibfecbc94f9eccefa7d3b1a50ae2598dfefb707a2 Reviewed-on: https://code.wireshark.org/review/18330 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-16addr_resolv(.c): no previous prototype for ↵Alexis La Goutte1-2/+2
‘add_ss7pc_name/ss7pc_name_lookup_init’ [-Wmissing-prototypes] Change-Id: Ice8c901e41e1881210c0f4bf70851810ca480e81 Reviewed-on: https://code.wireshark.org/review/18222 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-12MTP3: Added SS7 Point Code Name ResolutionBinh Trinh1-1/+169
bug: 7592 Change-Id: I1af2c5d6664e172c358cd19bc20e9352c2582eae Reviewed-on: https://code.wireshark.org/review/17677 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-13addr_resolv: use ws_strtou8 function.Dario Lombardo1-6/+7
This change prevents to accept netmasks as /24x. The mask must be an clean integer. Change-Id: I46aeb089dd6538b5cc4bde7efd4dc317621a5245 Reviewed-on: https://code.wireshark.org/review/17612 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-13Allocate all the wmem maps with epan scope.Guy Harris1-16/+3
That doesn't seem to affect the performance negatively (or positively...) to any noticeable degree with my simple "run tshark under the time command with an empty file" tests, and it does appear to reduce the amount of memory that valgrind thinks is leaked. All the other maps were already allocated with epan scope, so do that with these as well. Change-Id: Ib5ee85c8cf025e53455564a67cd1adbf28b47f78 Ping-Bug: 12656 Reviewed-on: https://code.wireshark.org/review/17040 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-14addr_resolv: change g_hash to wmem_map.Dario Lombardo1-137/+72
Change-Id: Ice7533fbeac700dae0a46766838818a32b0d5736 Reviewed-on: https://code.wireshark.org/review/15051 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-13Use getc_unlocked in a few places.Gerald Combs1-1/+1
Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This reduces startup time by about 100ms here. Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af Reviewed-on: https://code.wireshark.org/review/14518 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-06Move ip6_to_str_buf() to to_str.c and make it take the buffer length.João Valverde1-1/+1
Also make it use ws_inet_ntop6() (rather than implementing the string conversion ourselves). Remove ip6_to_str_buf_len(). Change-Id: I1eff3a8941e00987c2ff0c4dcfda13476af86191 Reviewed-on: https://code.wireshark.org/review/15692 Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-28Don't mix g_malloc() and wmem_alloc().Guy Harris1-1/+1
Always allocate sub_net_hashipv4 structures with wmem. Bug: 12386 Change-Id: Ibc4f09c267a2e651d9120ef67d4d5b77635172d6 Reviewed-on: https://code.wireshark.org/review/15152 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-28Cleanups to issues found while investigating 12386.Guy Harris1-14/+6
Get rid of the printable-IP-address member of a sub_net_hashipv4; it's not used. Free hash buckets of those structures iteratively, not recursively. Change-Id: I1ee8f46d3175a380e6a439fe71e7c06a0e939a3d Reviewed-on: https://code.wireshark.org/review/15150 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-25addr_resolv: async_dns_queue_head HAVE_C_ARES missingUli Heilmeier1-0/+2
async_dns_queue_head is only defined when HAVE_C_ARES is available. Therefore we should call it also only if HAVE_C_ARES is set. Change-Id: Iceb27096c188bb1b70ca89ee7782ca8d0990294d Reviewed-on: https://code.wireshark.org/review/15106 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-04-23addr_resolv: don't free the same wmem_list entry twiceMartin Kaiser1-0/+2
fetch the list head each time we iterate through the list if we don't, we crash when the same entry is removed a second time #0 wmem_block_remove_from_block_list (block=0x7fffecd7b1c0, allocator=<optimized out>) at wmem_allocator_block.c:738 #1 wmem_block_free_jumbo (chunk=0x7fffecd7b1d0, allocator=0x65c060) at wmem_allocator_block.c:822 #2 wmem_block_free (private_data=0x65c060, ptr=0x7fffecd7b1e0) at wmem_allocator_block.c:913 #3 0x00007ffff452eac1 in host_name_lookup_process () at addr_resolv.c:2466 #4 0x000000000041733d in process_packet (cf=cf@entry=0x63fe20, edt=edt@entry=0xce08f0, offset=<optimized out>, whdr=0xc97c70, pd=pd@entry=0xc9f550 "", tap_flags=tap_flags@entry=0) at tshark.c:3699 #5 0x000000000040f199 in load_cap_file (max_byte_count=13197776, max_packet_count=<optimized out>, out_file_name_res=0, out_file_type=2, save_file=0x0, cf=<optimized out>) at tshark.c:3483 #6 main (argc=<optimized out>, argv=<optimized out>) at tshark.c:2192 Change-Id: I1ac813242188842130f4070ef326b12fe23b782f Reviewed-on: https://code.wireshark.org/review/15068 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-22Don't fail in host_name_lookup_init() if manually resolved lists exist.Guy Harris1-4/+4
Those lists aren't destroyed by host_name_lookup_cleanup(), so don't assume in host_name_lookup_init() that they don't exist; just create them if they don't exist and leave them alone if they do. (GSLists and GLists are different from wmem_lists - a pointer to a GLib list is just a pointer to a list element, so an empty list is represented by a null pointer, but a wmem_list has a structure containing other information, so an empty list has null list pointers in that structure, and a null wmem_list * means the list doesn't exist at all.) Change-Id: I88c00cc9ac0812ab71adc70e3300ab3829fee8ab Reviewed-on: https://code.wireshark.org/review/15061 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-22addr_resolv: change g_slist to wmem_list.Dario Lombardo1-27/+26
Change-Id: Ifde09174e50bc2a9d695ac0a823e63f645284a10 Reviewed-on: https://code.wireshark.org/review/15050 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2016-04-21If you allocate with wmem, free with wmem.Martin Kaiser1-1/+1
This g_free() causes a crash on my system for every capture file where names are resolved. Program received signal SIGABRT, Aborted. 0x00007ffff0347125 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007ffff0347125 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x00007ffff034a3a0 in *__GI_abort () at abort.c:92 #2 0x00007ffff038135b in __libc_message (do_abort=<optimized out>, fmt=<optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 #3 0x00007ffff038abb6 in malloc_printerr (action=3, str=0x7ffff0464532 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:6312 #4 0x00007ffff038f95c in *__GI___libc_free (mem=<optimized out>) at malloc.c:3738 #5 0x00007fffef8cca41 in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #6 0x00007fffef8ccad2 in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #7 0x00007fffef8cceea in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #8 0x00007fffef8d501b in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #9 0x00007fffef8d3a4a in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #10 0x00007fffef8d4792 in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #11 0x00007fffef8d49de in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #12 0x00007fffef8d4cc7 in ?? () from /usr/lib/x86_64-linux-gnu/libcares.so.2 #13 0x00007ffff4329713 in host_name_lookup_process () at addr_resolv.c:2485 #14 0x000000000053fda9 in WiresharkApplication::refreshAddressResolution (this=0x7fffffffe2f0) at wireshark_application.cpp:217 #15 0x000000000059c42d in WiresharkApplication::qt_static_metacall (_o=0x7fffffffe2f0, _c=<optimized out>, _id=<optimized out>, _a=0x7fffffffd7b0) at wireshark_application.moc.cpp:142 #16 0x00007ffff140654f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 Change-Id: I20586929463259f71f325225975eec241166f123 Reviewed-on: https://code.wireshark.org/review/15047 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-21If you allocate with wmem, free with wmem (more of same).Guy Harris1-1/+1
Change-Id: I10991dcb717a38936e2b7cf2f15885b5753378d0 Reviewed-on: https://code.wireshark.org/review/15034 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-21If you allocate with wmem, free with wmem.Guy Harris1-1/+1
Change-Id: I91476c825448cbeb8b96242236aae44d92244161 Reviewed-on: https://code.wireshark.org/review/15033 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-21addr_resolv: change g_malloc to wmem_alloc.Dario Lombardo1-56/+56
Change-Id: I25d4e82d6161c26d4f560bd495293c77671e00eb Reviewed-on: https://code.wireshark.org/review/15021 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-08Replace and remove host_ip_af() functionJoão Valverde1-28/+0
Change-Id: I932c156cbc6883d1d63bf0457fd62cfb67c3340e Reviewed-on: https://code.wireshark.org/review/14750 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-04-04Remove synchronous DNS name resolutionJoão Valverde1-192/+43
Change-Id: Ie5e670b769eb0674950f3679ef511047641c2873 Reviewed-on: https://code.wireshark.org/review/14751 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-22Remove more missed ADNS codeJoão Valverde1-60/+0
Fixup for 7a1d3f67ac83e12645a91b5329b6e8163954f77e. Change-Id: Idb8d68a3cc114545f24738cead4968804d831346 Reviewed-on: https://code.wireshark.org/review/14548 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-21Remove ADNS supportJoão Valverde1-124/+5
Relevant mailing list message: https://www.wireshark.org/lists/wireshark-dev/201503/msg00007.html Change-Id: I0cff6d4d64fb52a651bcf6b28c183e43653b1cc2 Reviewed-on: https://code.wireshark.org/review/14519 Reviewed-by: João Valverde <j@v6e.pt>
2016-03-18IEEE 802.1Q/VLAN: Resolve ID to a describing nameUli Heilmeier1-1/+198
A vlans file in the personal preference directory add an option to resolve VLAN IDs to a describing name. Format of vlan file is 123\tName of VLAN To enable the resolving the preference nameres.vlan_name must be set to TRUE. Bug: 11209 Change-Id: I3f00b4897aace89c03c57b68b6c4b6c8b7d4685a Reviewed-on: https://code.wireshark.org/review/14471 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-29Only say we have a new resolved MAC address if it's actually *new*.Guy Harris1-3/+5
If we aren't changing the resolved name, it's not new. This prevents us from perpetually "resolving" the address. If we have ARP packets that cause us to map a MAC address to a host name, based on the ARP packet saying the MAC address corresponds to a given resolved IP address, then each time we dissect the packet, the address will be "resolved" - and each time we have new resolved addresses as a result of that, we'll redissect the displayed packets so that they show the resolved address, and we'll forever be redissecting. Change-Id: I445e92f407d52a4ed5986721ffcc472f86e99431 Reviewed-on: https://code.wireshark.org/review/14236 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-19Add inet_pton/inet_ntop interface to libwsutilJoão Valverde1-57/+25
Change-Id: Ifc344ed33f2f7ca09a6912a5adb49dc35f07c81f Reviewed-on: https://code.wireshark.org/review/13881 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-13Just #include wsutil/inet_aton.hJoão Valverde1-4/+1
No need for platform-specific system header boilerplate. Change-Id: I5387a0005ddb0d7aab3c5b9f28d6282053c1b0fd Reviewed-on: https://code.wireshark.org/review/13865 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-11Change some constness qualificationsJoão Valverde1-4/+4
Change-Id: I0ece488f43aae27e7c055c2edacbf09ff11ce16d Reviewed-on: https://code.wireshark.org/review/13889 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-19Don't use IP address strings as "names" for MAC addresses.Guy Harris1-47/+49
Have a flag for addresses indicating whether the address is resolved to a name or whether its "name" is just a printable version of the address. If the name corresponding to an IP address isn't really a name, don't assign it to a MAC address. Clean up some code a bit (have a fill_dummy_ip6() corresponding to fill_dummy_ip4()). Bug: 10212 Change-Id: I9d0ffa2706be17842f832c64cea7acc5c1dc6536 Reviewed-on: https://code.wireshark.org/review/13412 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-1/+1
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-03Rename ipv6-utils.h to ipv6.h.Guy Harris1-1/+1
By analogy to ipv4.h. Change-Id: I147565b332024b1bb88e9cd15889255773d04524 Reviewed-on: https://code.wireshark.org/review/13034 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-03Fix some constness issues [-Wcast-qual]João Valverde1-2/+2
Change-Id: I111558df3d36436ddf5e2728f113b022cc48a713 Reviewed-on: https://code.wireshark.org/review/13013 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-23Remove configure --enable-ipv6 optionJoão Valverde1-6/+2
It's an ancient obsolete option with a confusing name. Change-Id: Ib10330cf859cdea18fed2077c6539e56350ef380 Reviewed-on: https://code.wireshark.org/review/11967 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-4/+0
Have wsutil/file_util.h include them on UN*X, just as it includes io.h on Windows, so we can have a rule of "if you do file operations, include <wsutil/file_util.h> and use the routines in it". Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't necessary (whether because of the addition of them to wsutil/file_util.h or because they weren't needed in the first place). Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f Reviewed-on: https://code.wireshark.org/review/11619 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04Don't include libwireshark headers from libwiretap.Guy Harris1-1/+1
Move the definitions of hashipv4_t and hashipv6_t to wiretap/wtap.h, as that's the main place they're used. Change them a bit not to depend on other stuff from libwireshark, and change the code as required by those changes. This should fix the Solaris build; apparently, the Sun^WOracle compiler is generating code for static inline functions even if they're never called, so that libwiretap ends up including code that calls tvbuff and wmem functions. There's probably further cleanup that could be done here, but this should at least fix the build, as well as getting rid of a dependency between two libraries that are at least somewhat independent (libwiretap should *not* depend on libwireshark, as some programs use libwiretap but not libwireshark, and, ultimately, we probably want it to be possible to use libwireshark without libwiretap but that'd be more work). Change-Id: I91c745282f17d7c8bff7809aa277eab2b3cf47c1 Reviewed-on: https://code.wireshark.org/review/11537 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-1/+1
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-18Don't parse services file twice, respect user settingsJoão Valverde1-34/+6
Platform file '/etc/services' is the same as Wireshark's '/usr/share/wireshark/services', only Wireshark's is more recent (on my system, same goes for other platforms I assume). Use only Wireshark's IANA services files. Other benefits would be removing some platform specific #ifdefs and making service names more consistent. Also respect user services settings by parsing $PERSCONFIG_DIR/services after $SYSCONFIG_DIR/services. Change-Id: I9890473af92763e02dabd2386eaa767aed2f2899 Reviewed-on: https://code.wireshark.org/review/10941 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-11Remove duplicate transport ports from proto tree summaryJoão Valverde1-75/+68
Don't display duplicate ports if transport name resolution is not enabled (for UDP/TCP/DCCP). Also introduce col_append_port() to handle info column port display with name resolution in a uniform format. Change-Id: Icb8ac45f726b7c539b4534c62061473e9b582753 Reviewed-on: https://code.wireshark.org/review/10804 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05Add BASE_PT_ field display typesJoão Valverde1-6/+17
Avoid displaying duplicate port numbers with transport name resolution disabled and make some dissector code simpler. Introduces port_with_resolution_to_str_buf() function and amends UDP/TCP/DCCP/SCTP to use the new field display type. Change-Id: Ifb97810b9c669ccbb1a310a2c0ffd6e2b63af210 Reviewed-on: https://code.wireshark.org/review/10625 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-27addr_resolv: cosmetic change for flagsPeter Wu1-13/+13
Reduce some magic numbers and add parentheses, change ((flags & X) == X) to simply (flags * X), change tp->flags = tp->flags | x to tp->flags |= x. Change-Id: Ida2d1aa59a3efc20d5fe6910d7b757277eb7e627 Reviewed-on: https://code.wireshark.org/review/10659 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-08-18Init values set (found by American Fuzzy Lop).Dario Lombardo1-1/+1
Change-Id: Iddd2b4a0ceb409db1afb1a412339134634de631c Reviewed-on: https://code.wireshark.org/review/10104 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-07-25DNS: move DNS name resolution pref to Name Resolution prefsHadriel Kaplan1-1/+24
Move the boolean flag for using captured DNS packet info for name resolution to the Name Resolution preferences settings, as it was rather surprising to disable Name Resolution preferences and still have names being resolved. Also disble them all if the '-n' command line switch is used, and re-enable it for a 'd' character in the '-N' option. Bug: 10337 Change-Id: Ie4d47bab0100db3360cc447cd3e446b2e39aa917 Reviewed-on: https://code.wireshark.org/review/9786 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-03Fix address resolution for columns.Guy Harris1-54/+0
Have address_to_name() be a routine that takes an address and returns a string with a "sufficiently long" lifetime for use in columns, using the address type's addr_name_res_str routine for most address types, rather than having a too-small set of address types wired into it. It replaces both the internal solve_address_to_name() routine and get_addr_name(), and can, for example, handle the special WLAN address types rather than leaving them unresolved even with an ethers file. Change-Id: Id09bc412adf5d2752155650a14a77c5378af2e42 Reviewed-on: https://code.wireshark.org/review/9475 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-21Fix memory leak printing eui64sEvan Huus1-3/+7
The scope that is passed in should only be used for the return value - other temporary buffers we must alloc/free ourselves, since if the scope is NULL they will not be managed automatically. Bug: 11293 Change-Id: I27be856f1c5cdf47f78e766192a29523664a543e Reviewed-on: https://code.wireshark.org/review/9007 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-09Remove the executable bit from epan/addr_resolv.cEvan Huus1-0/+0
It was added (presumably by accident) in 41ac67c. Change-Id: If9c2daae6d9f6a0f09fc04c5332faeaa69d355c2 Reviewed-on: https://code.wireshark.org/review/8855 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-09Fix insertion of subnets read from the subnets file: append to the *end* ofChristopher Maynard1-9/+15
the list. The patch ensures that non-duplicate subnets are appended to the end of the list rather than as the second element, which if there had been a second element previously, the memory for it was effectively leaked. It also allows /32 "subnets", even though arguably the hosts file should be used instead, but now the test in read_subnets_file() matches the assert in subnet_entry_set(). Bug: 11247 Change-Id: I54bf1cbb34edfcf410aa634043a377c27091df51 Reviewed-on: https://code.wireshark.org/review/8802 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-18Complete the fix from g6b5c71a.Gerald Combs1-1/+0
Change-Id: I18360cbc50d790a22e69e85dcc16363f8c682c64 Reviewed-on: https://code.wireshark.org/review/7739 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-18Don't cache existing IPv4 and IPv6 hostnames.Gerald Combs1-13/+14
In the Qt UI redrawing the packet list redissects our visible packets, which might call add_ipv{4,6}_name, which sets new_resolved_objects = TRUE, which emits the addressResolutionChanged signal, which redraws the packet list, which ... Break out of the loop by checking to see if we've already cached an IPv4 or IPv6 hostname. Change-Id: Icb2841e3453fb98d4cf0ea06a0f49737e2b8f25e Reviewed-on: https://code.wireshark.org/review/7738 Reviewed-by: Gerald Combs <gerald@wireshark.org>