diff options
author | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-01-23 16:45:03 +0000 |
---|---|---|
committer | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-01-23 16:45:03 +0000 |
commit | e5db98ec731ad7308c9053bcd430d625a3352320 (patch) | |
tree | 7c4445eec2fd7613fea2be6fe458b3b5d95979be /wiretap/visual.c | |
parent | e4b55bb83002ee726bbe6be062702a22a3e49a83 (diff) |
Fix for bug 4408:
Make further encapsulation determination between "VC-multiplexed PPP" and "LLC encapsulated PPP". See RFC 2364.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31634 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r-- | wiretap/visual.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c index c43b34777a..7227a335ee 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -275,7 +275,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info) wth->subtype_read = visual_read; wth->subtype_seek_read = visual_seek_read; wth->subtype_close = visual_close; - wth->tsprecision = WTAP_FILE_TSPREC_USEC; + wth->tsprecision = WTAP_FILE_TSPREC_USEC; /* Add Visual-specific information to the wiretap struct for later use. */ visual = g_malloc(sizeof(struct visual_read_info)); @@ -446,7 +446,19 @@ static gboolean visual_read(wtap *wth, int *err, gchar **err_info, /* If PPP is specified in the encap hint, then use that */ if (vpkt_hdr.encap_hint == 14) { - wth->phdr.pkt_encap = WTAP_ENCAP_PPP_WITH_PHDR; + /* But first we need to examine the first three octets to + try to determine the proper encapsulation, see RFC 2364. */ + guint8 *buf = buffer_start_ptr(wth->frame_buffer); + if ((0xfe == buf[0]) && (0xfe == buf[1]) && (0x03 == buf[2])) + { + /* It is actually LLC encapsulated PPP */ + wth->phdr.pkt_encap = WTAP_ENCAP_ATM_RFC1483; + } + else + { + /* It is actually PPP */ + wth->phdr.pkt_encap = WTAP_ENCAP_PPP_WITH_PHDR; + } } else { |