Commit Graph

336 Commits

Author SHA1 Message Date
Martin Mathieson d70a4a9321 Standardise IETF RFC and Draft URLs in dissectors.
Prefer:
- html (rather than txt)
- https

Also includes the script check_dissector_urls.py,
that can be used to find links in code and test them.

Change-Id: Iafd8bb8948674a38ad5232bf5b5432ffb2b1251b
Reviewed-on: https://code.wireshark.org/review/36821
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-04-13 14:58:48 +00:00
Uli Heilmeier bb352dc0db BGP: Update/Fix Extended Communities
Changed and updated BGP extended communities according to:

* https://www.iana.org/assignments/bgp-extended-communities/bgp-extended-communities.xhtml
* RFC 7674
* RFC 8317
* RFC 7796
* draft-ietf-bess-evpn-inter-subnet-forwarding-08

Bug: 16449
Change-Id: Idaf1026ac4e3162ba54c163782261379931803e0
Reviewed-on: https://code.wireshark.org/review/36803
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-04-12 19:02:47 +00:00
Uli Heilmeier 1fa51cfc0c BGP: MPLS label for EVPN Extented community
Dissect MPLS label fields for EVPN Extented Community.
RFC7432 section-8.2.1 defines only a SHOULD for ESI label set to a MPLS
label when Single-Active redundancy mode is desired.
Therefore and not break current implemntation we only add the additional
dissection of the MPLS label bits.

Bug: 16313
Change-Id: Iad2561b90aeace212f79a874efb59af917aca3f1
Reviewed-on: https://code.wireshark.org/review/35692
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-10 06:29:28 +00:00
Jaap Keuter 10ef28df30 BGP: Add EVPN Layer 2 Attributes Extended Community (RFC 8214)
Bug: 16287
Change-Id: Ic76972c2c99d0206c68703bee924c0e16ffdeae7
Reviewed-on: https://code.wireshark.org/review/35702
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-09 07:14:46 +00:00
Uli Heilmeier 984c7a9c42 BGP: update Well-known Communities
Update the well-known communities as defined by
https://www.iana.org/assignments/bgp-well-known-communities/bgp-well-known-communities.xhtml

Communities for expired drafts has been ignored.

Change-Id: I3dedea2bdaad8feda3c7f1d9886092d4c02d6f95
Reviewed-on: https://code.wireshark.org/review/35602
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 13:07:51 +00:00
Uli Heilmeier 4f105e1f24 BGP: Support for drafts Tunnel Encapsulation and Segment Routing
Add support for BGP Tunnel Encapsulation Attribute
(draft-ietf-idr-tunnel-encaps-15) and Advertising Segment
Routing Policies in BGP (draft-ietf-idr-segment-routing-te-policy-08).

Due to missing pcap file(s) most of the Segment List Sub-TLVs
are still missing.

Bug: 16294
Change-Id: I0d7524934d5c5f2458a3f9a68e1e49c95a030c32
Reviewed-on: https://code.wireshark.org/review/35587
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-02 05:53:13 +00:00
Michael Pergament 4370164419 BGP: Add D-PATH Attribute
Add D-PATH Attribute as described in
draft-rabadan-sajassi-bess-evpn-ipvpn-interworking

Bug: 16238
Change-Id: If40699304fca1409a195b83075dd40c6769c2df4
Reviewed-on: https://code.wireshark.org/review/35223
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-11-28 13:34:45 +00:00
mpergament1975 1178c59c05 BGP EVPN: Adding Type 10 route support
(draft-ietf-bess-evpn-bum-procedure-updates-07)

Change-Id: I8187da5bb9f8fa84a4c5835ff5c61a6669d4fb32
Reviewed-on: https://code.wireshark.org/review/34998
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-06 13:26:11 +00:00
Uli Heilmeier 7dfe906176 BGP: IPv6 Linkstate Prefix Reachability info
Add IP version to call the right decode_prefix function.

Bug: 16144
Change-Id: I06239863b98beeef9ff80e1a8b6e13b4113fb065
Reviewed-on: https://code.wireshark.org/review/34913
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-03 13:16:05 +00:00
Colin Sames 5db3ef90de BGP: Add dissector for BGPsec Updates.
RFC8205 specifies the BGPsec extension. The extended Wireshark dissector
consists of:

- BGPsec Capability
    a capability that holds the BGPsec version, a direction and reserved
    bits.
- BGPsec_PATH
    a BGP path attribute. Such a path contains Secure Path Segments and
    Signature Segments.

Change-Id: Iba5e17b9139bcac378adf2bcc2dfb369064f7a08
Reviewed-on: https://code.wireshark.org/review/34639
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-09-28 18:54:53 +00:00
João Valverde 343adfc60e BGP: Fix indentation
Change-Id: I0957a8ce104c5ff81680e722c564337eff052c2f
Reviewed-on: https://code.wireshark.org/review/34642
Reviewed-by: João Valverde <j@v6e.pt>
2019-09-28 12:54:58 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Uli Heilmeier fb0cb6373c BGP: Update description for IE Flag (EVPN IGMP)
Ping-Bug: 15911
Change-Id: I2607eb96e8a217451a493a301dc06b56a4db3081
Reviewed-on: https://code.wireshark.org/review/33966
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-07-17 07:07:49 +00:00
Uli Heilmeier 79484e84fd BGP: Adding draft-ietf-bess-evpn-igmp-mld-proxy
Adding support for draft-ietf-bess-evpn-igmp-mld-proxy-03

Bug: 15911
Change-Id: I42c0cf4551a7669742457691cc820a4057faf697
Reviewed-on: https://code.wireshark.org/review/33951
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-16 06:41:55 +00:00
Alexis La Goutte ad72d54855 BGP: Update Tunnel Encapsulation Attribute Types (and SubType)
From IANA https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml

Ping-Bug: 15746
Change-Id: I1f0fc25cd814453546a635e063cf2807cfc6c89a
Reviewed-on: https://code.wireshark.org/review/33059
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-05-06 16:08:24 +00:00
Alexis La Goutte d6ab4f792b BGP: Add missing SAFI Segment Routing Policy (73)
Change-Id: I63cb9c6420cf1db503fc826a8e43b33518000758
Ping-Bug: 15746
Reviewed-on: https://code.wireshark.org/review/33051
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Uli Heilmeier <openid@heilmeier.eu>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-05-05 18:56:49 +00:00
Uli Heilmeier 78f3b8afe9 BGP: Fix handling of MPLS label for RFC7432
RFC7432 defines MPLS label with a fixed size and not as a stack.
Each label has 3 bytes and we only decode the first 20 bits. The
remaining four bits are not defined. Therefore we ignore it at the
moment.

Bug: 15631
Change-Id: I27e34e91facb169b804993f2d3ac9c4a181454aa
Reviewed-on: https://code.wireshark.org/review/32578
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-03-26 14:43:57 +00:00
Uli Heilmeier d4c8f700e6 BGP: Add LS Advertisment of IGP TE Metric (RFC8571)
Adding support for RFC8571 (BGP - Link State (BGP-LS)
Advertisement of IGP Traffic Engineering Performance Metric Extensions)

Change-Id: I2f0b415a1a5c3e5f0eb79a6e3758b17c5beba851
Reviewed-on: https://code.wireshark.org/review/32497
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-22 05:16:15 +00:00
Uli Heilmeier 84750864e5 BGP: adding support for RFC8538
Adding RFC8538 (Notification Support for BGP GR).

Change-Id: I3af5a008fbaa4fb288b55e2837ffeb368423d4e9
Reviewed-on: https://code.wireshark.org/review/32395
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-13 13:10:16 +00:00
Joerg Mayer 7a48f17df6 packet-bgp.c: Add decoding of enhanced next hop capability
Change-Id: I025df39662d404e6ba12cdabe763c4638bb8c157
Reviewed-on: https://code.wireshark.org/review/31932
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2019-02-07 17:15:26 +00:00
Joerg Mayer 81694c8498 Update BGP capabilities list
Change-Id: I4085b4e3ed4ea587b757e64068995e155eabc543
Reviewed-on: https://code.wireshark.org/review/31705
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2019-01-23 17:20:39 +00:00
Uli Heilmeier ee7e414ac5 BGP: Decode next hop BGP MP_REACH_NLRI for MCAST-VPN saf
Ref: https://tools.ietf.org/html/rfc6514#section-9.1.1

Bug: 15376
Change-Id: I60aaeadb4a58f2b16630ba184d3ad9841bc32436
Reviewed-on: https://code.wireshark.org/review/31171
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-23 06:48:17 +00:00
Uli Heilmeier 0a49561e96 BGP: Decode MCAST-VPN safi for IPv6
Bug: 15351
Change-Id: Iaac74d6e1e78a4dde2a2f807b909177c733fd05f
Reviewed-on: https://code.wireshark.org/review/31007
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-11 16:29:09 +00:00
Gerald Combs 8c22c5bade Fix some spelling errors found by Lintian.
Change-Id: If6fc3aab7ad4fc634567121f7b9541bc6f6c5766
Reviewed-on: https://code.wireshark.org/review/30926
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-05 18:58:19 +00:00
Jaap Keuter f810837318 BGP: Fix dissection of MCAST-VPN NLRI
Due to a incorrect check the details of MCAST-VPN NLRI were
never dissected. Also the Originating Router's IP Addr of a
S-PMSI A-D Route was not dissected.

Bug: 15307
Change-Id: Ic7481ed034e4cbf0dcab4aa150f05da2f5aac508
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/30796
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-27 04:33:48 +00:00
Guy Harris 42c9bee36f Flag invalid markers.
Change-Id: I8d99fa2b46ffb96100ea0e47273761d9c47e14cb
Reviewed-on: https://code.wireshark.org/review/29831
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-25 18:57:41 +00:00
Guy Harris 767f700891 draft-ietf-idr-bgp-ext-communities became RFC 4360.
Change-Id: Id0be05c8abc85dac14f9fbb597b387b1d37552c5
Reviewed-on: https://code.wireshark.org/review/29406
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-03 20:59:55 +00:00
Vadim Fedorenko 9ba6d3fbc0 BGP: Break off IPv6 LU NLRI into its own fields
Change-Id: I2c0b521369c30d651a39f49f72bd93986499c96e
Reviewed-on: https://code.wireshark.org/review/28559
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-03 07:54:33 +00:00
Vadim Fedorenko 1f5c420508 BGP-MP NLRI can have Path ID for IPv4 Unicast/Multicast and Labeled Unicast
Change-Id: Ieb46c9d5dbafbf33bfd1ddda0b0397509fdada4f
Reviewed-on: https://code.wireshark.org/review/28436
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-06-27 00:50:06 +00:00
Darius Davis 6e88943d0e BGP: Validate length of Path Attribute records.
Bug 13741 showed a case where the BGP dissector's failure to validate the
length of the Path Attribute record allowed a pathological BGP UPDATE packet to
generate more than one million items in the protocol tree by repeatedly
dissecting certain segments of the packet.

It's easy enough to detect when the Path Attribute length cannot be valid, so
let's do so.  When the condition arises, let's raise an Expert Info error in
the same style and format as used elsewhere in the same routine, and abandon
dissection of the Path Attributes list.

With this check in place, an incorrect length computation is revealed at a
callsite.  This would only have prevented a small (less than 5 bytes) Path
Attribute from being dissected if it was at the very end of the Path Attributes
list, but the bounds checking added in this change makes this problem much more
apparent, so we fix the length computation while we're here.

Testing Done: Built wireshark on Linux amd64.  Using bgp.pcap from the Sample
   Captures page on the wiki, verified that the dissection of the UPDATE
   packets were unaltered by this fix.  Using the capture attached to bug 13741
   (clusterfuzz-testcase-minimized-6689222578667520.pcap), verified that the
   packet no longer triggers the "too many items" exception, instead we see
   an Expert Info for each oversized Path Attribute length, and eventually an
   exception for "length of contained item exceeds length of containing item".
   30,000 iterations of fuzz test with bgp.pcap as input, and many iterations
   of randpkt-test too.  Crafted a packet with a 3-byte ATOMIC_AGGREGATE Path
   Attribute at the end of the Path Attributes list; Before this change, an
   exception is raised during dissection, but after this change it is dissected
   correctly.

Bug: 13741
Change-Id: I80f506b114a61e5b060d93b59bed6b94fb188b3e
Reviewed-on: https://code.wireshark.org/review/27466
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-14 08:17:09 +00:00
ytti 3ebfa39cef BGP path attribute AGGREGATOR (7) may be 32bits
https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml
https://tools.ietf.org/html/rfc4893
-------------------------------------------
   NEW BGP speakers carry AS path information expressed in terms of 4-
   octet Autonomous Systems numbers by using the existing AS_PATH
   attribute, except that each AS number in this attribute is encoded
   not as a 2-octet, but as a 4-octet entity.  The same applies to the
   AGGREGATOR attribute - NEW BGP speakers use the same attribute,
   except that the AS carried in this attribute is encoded as a 4-octet
   entity.
-------------------------------------------

Change-Id: I4ccfc2c18e8777a800211dd285550723ac0da872
Reviewed-on: https://code.wireshark.org/review/26647
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-27 11:56:54 +00:00
Uli Heilmeier eb15a1ed19 BGP: Heuristic for IPv6 NLRI path identifier
NLRIs can contain path identifiers as defined in RFC7911.

This commit adopts the IPv4 heuristic to IPv6 to detect usage
of additional path identifier.

Bug: 14241
Change-Id: I6b99c079b12d1f9a3e05b152a5540a621076e965
Reviewed-on: https://code.wireshark.org/review/26157
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-02-28 06:20:20 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Uli Heilmeier 80cd3859d1 BGP: Resolve AS23456 to AS_TRANS
AS23456 is reserved in RFC6793 for 32-bit AS number range as AS_TRANS.
Add an additional text "(AS_TRANS)" to AS 23456 items.

Bug: 14305
Change-Id: I1a0ea9e07c74b7e409cb32e2da55dbf233a2348d
Reviewed-on: https://code.wireshark.org/review/25172
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-10 06:00:19 +00:00
Alexis La Goutte be143963f6 BGP: Add dissection of data field on BGP NOTIFICATION message (OPEN/Bad Peer AS)
Bug: 14304
Change-Id: Ic69b43c58f9e02f91900dc618e4429cfc6ddfcac
Reviewed-on: https://code.wireshark.org/review/25217
Reviewed-by: Uli Heilmeier <openid@heilmeier.eu>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-10 05:32:06 +00:00
Uli Heilmeier 2b4322ceba BGP: add Open message error/unsupported capability
According to RFC 5492 [1], paragraph 5, Data field of BGP
notification for Open message error/unsupported capability must
list the set of unsupported capabilities

Bug: 14274
Change-Id: Iacd33b5c83bc234652d2a5444f0029640d33e1c5
Reviewed-on: https://code.wireshark.org/review/24829
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-16 08:23:48 +00:00
Alexis La Goutte ea6204cab6 BGP: display ESI 10bytes value (and not a decoded value)
Bug: 14200
Change-Id: I6d8ac6aae952db21e69fa323fb1e74782d95d1c4
Reviewed-on: https://code.wireshark.org/review/24362
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-23 19:47:39 +00:00
Michael Mann ef17ead772 BGP: Add Path Identifier to IPv6 NLRI
Bug: 14241
Change-Id: I5e66b034cf5cd14e2557e5b7bfa3045c2232d1ae
Reviewed-on: https://code.wireshark.org/review/24553
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-23 17:51:47 +00:00
Alexis La Goutte 9a1a8f77e9 BGP: enhance display
Display LACP Port Key/root Bridge Priority in Dec and Hex
mSTP => MSTP

Change-Id: I7079250da134e4bb60d2d5373bfdf2f31235f07a
Ping-Bug: 14200
Reviewed-on: https://code.wireshark.org/review/24401
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-21 21:17:23 +00:00
Guy Harris 458c3c026e Add a ws_in6_addr typedef for struct e_in6_addr.
That allows a parallel typedef of ws_in4_addr for guint32.

Change-Id: I03b230247065e0e3840eb87635315a8e523ef562
Reviewed-on: https://code.wireshark.org/review/24073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 08:50:34 +00:00
Stig Bjørlykke b96b145f58 epan: Fix misuse of comma operator
Change-Id: Ie088dea1239286cb413ddcfc2a82e4a5e3fb9e0f
Reviewed-on: https://code.wireshark.org/review/23551
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-15 13:16:52 +00:00
Michael Mann 5c27cb5f83 packet-bgp.c: using wmem_packet_scope() for decode_evpn_nlri_esi
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2736
Bug: 13995
Change-Id: Ia304251249e023a77a8fa3a650ef1640c3c2f314
Reviewed-on: https://code.wireshark.org/review/23168
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-23 02:57:33 +00:00
Junpei Yoshino 956ebf3719 Support multiple labels with bgp
Passing multiple labels information with BGP has come to be used
together with segment routing.

Change-Id: Ifd45eb0a875ed4a166e44441955e5e42ce84a7ca
Reviewed-on: https://code.wireshark.org/review/22944
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-08 01:04:55 +00:00
Alexis La Goutte c4c4c44a21 BGP: fix incorrect decoding COMMUNITIES whose length is larger than 255
Issue reported by Kura

Bug: 13872
Change-Id: I054839a9e141fa4a882114b150842366c090d012
Reviewed-on: https://code.wireshark.org/review/22537
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>
2017-07-08 00:08:22 +00:00
Evelio Vila c47c66cb0b Add BGP dissector support for draft-ietf-idr-bgp-prefix-sid-05
Bug: 12296
Change-Id: Ib49396e2822f6ee0082aedd39ed8636379bbd75a
Reviewed-on: https://code.wireshark.org/review/21726
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-09 11:50:09 +00:00
Pascal Quantin 0bd1190393 BGP: fix a variable underflow
Bug: 13557
Change-Id: I882c8a7161ff233e289a413579ed51c3b8f43c36
Reviewed-on: https://code.wireshark.org/review/20940
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-06 04:50:06 +00:00
Simon Zhong f53333f433 BGP: Update BGP Path Attributes with latest IANA assignment.
Change-Id: I6f66a5d51677db6cfea279c322ef9f976452de90
Reviewed-on: https://code.wireshark.org/review/20930
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>
2017-04-05 21:44:45 +00:00
Pascal Quantin 8350873a46 BGP: remove some true_false_string values obsoletes after gf998923
Change-Id: I10753353d0593b736630118ccf0a797d48e087b8
Reviewed-on: https://code.wireshark.org/review/20847
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-02 14:54:12 +00:00
Simon Zhong f998923bae BGP: Remove redundant text in Path Attributes.
Also added display of lower-order four bits of the Attribute Flags ("unused").

 Current implementation of displaying path attribute flags shows flag description twice if the flag was set.

 For example, with Optional and Length set, the attribute flags were displayed as follows:

             Flags: 0x90, Optional, Length: Optional, Non-transitive, Complete, Extended Length
                 1... .... = Optional: Optional
                 .0.. .... = Transitive: Non-transitive
                 ..0. .... = Partial: Complete
                 ...1 .... = Length: Extended length

 Now they are displayed as follows:

            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
                1... .... = Optional: Set
                .0.. .... = Transitive: Not set
                ..0. .... = Partial: Not set
                ...1 .... = Extended-Length: Set
                .... 0000 = Unused: 0x0

Change-Id: Iec3c92ac2383dd3f736598b089a74f0f3c165bae
Reviewed-on: https://code.wireshark.org/review/20732
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>
2017-04-02 06:53:05 +00:00
Alexis La Goutte 67f8b957d3 BGP: fix conflicting entry in its value_string
Field 'Type Code' (bgp.update.path_attribute.type_code) has a conflicting entry in its value_string: 29 is at indices 19 (LINK_STATE) and 20 (Deprecated))

Change-Id: Ifd0c7a2a095d2b216115b94ca0b71e0dca2213ee
Reviewed-on: https://code.wireshark.org/review/20741
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-27 15:26:33 +00:00
Alexis La Goutte a5b6103942 BGP: Fix dissection of BGP ADD-PATH capability
not limited to len = 4 (can be a multiple of 4)

Bug: 13521
Change-Id: I668dbff6d8a7b0a4260da31393bb70d2c5431455
Reviewed-on: https://code.wireshark.org/review/20705
Petri-Dish: 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>
2017-03-26 07:15:31 +00:00
IWASE Yusuke 3ddaa5ebc9 BGP: Decode Route Distinguisher in VPN Flow Specification
RFC5575 says Route Distinguisher is inserted between "length" and "NLRI
value" fields when the BGP NLRI type is VPNv4 Flow Spec (AFI=1,
SAFI=134) and this is the same for VPNv6 and L2VPN.

This patch fixes the BGP dissector to decode the missing Route
Distinguisher field in Flow Spec NLRI decoder.

Change-Id: Ib45d96bb399b80be69ca70ea552d2c07b07a9782
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Reviewed-on: https://code.wireshark.org/review/20653
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: Anders Broman <a.broman58@gmail.com>
2017-03-24 04:35:48 +00:00
Simon Zhong af79cf1700 BGP: Fix incorrect desegment_len value.
Change-Id: I9a8f0b6877ce15f1e4672dd9dc884571de6f7f7e
Reviewed-on: https://code.wireshark.org/review/20510
Petri-Dish: 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>
2017-03-22 05:04:21 +00:00
Simon Zhong 9ea5b08da6 BGP: Update Transitive Four-Octet AS-Specific Extended Community Sub-Types and remove duplicate marcos.
Change-Id: I87454ea95bc64a39e4e60ba374e9cafb574e744c
Reviewed-on: https://code.wireshark.org/review/20501
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>
2017-03-12 08:50:38 +00:00
Stig Bjørlykke f8abec1f37 bgp: Avoid divide by zero
Bug: 13476
Change-Id: I399df46c9d5f6d0d464ecc9cf8d44eddf709f7dc
Reviewed-on: https://code.wireshark.org/review/20499
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-11 23:57:56 +00:00
Simon Zhong 5b9879806d BGP: Fix the issue that SAFI 72 (BGP-LS-VPN) was not decoded.
Change-Id: I2aef41458c89975dddea4d8bb6355bb7aabd1cad
Reviewed-on: https://code.wireshark.org/review/20488
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-11 09:23:16 +00:00
Alexis La Goutte 43f2177d7c BGP: fix this statement may fall through [-Werror=implicit-fallthrough=] found by gcc7
Change-Id: I7cb6f73efb1e37eba977dc6912041d5969989696
Reviewed-on: https://code.wireshark.org/review/20399
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-06 01:50:38 +00:00
Alexis La Goutte 351e8924d3 BGP: Update some draft to final RFC
draft-ietf-idr-aigp -> RFC7311
draft-ietf-idr-ls-distribution -> RFC7752
draft-ietf-idr-large-community -> RFC8092

Change-Id: Ia05809ed88514f3a0c221af2aaea779f24be99e7
Reviewed-on: https://code.wireshark.org/review/20187
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>
2017-02-19 21:20:45 +00:00
Alexis La Goutte 9ce32f995c BGP: add Deprecated BGP Path Attribute (RFC 8093)
Change-Id: I18f01f8c989a8d25a168761f22b4cf6e2b51bf18
Reviewed-on: https://code.wireshark.org/review/20182
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-19 21:19:53 +00:00
Arjen Zonneveld 4a1150acdd Also show BGP Shutdown communication on admin reset
Shutdown communication is now also allowed on Admin Reset NOTIFICATION messages:
https://tools.ietf.org/rfcdiff?url2=draft-ietf-idr-shutdown-04.txt

Change-Id: I6450d3d5de5aef4bd709ba2b211ca717784b00a7
Reviewed-on: https://code.wireshark.org/review/19886
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-01-31 17:13:35 +00:00
Alexis La Goutte d4e3975ee7 BGP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I0569326140c88a6dd2d7e2b8819c9f5323a98670
Reviewed-on: https://code.wireshark.org/review/19810
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-31 06:45:38 +00:00
Guy Harris 11574208e7 Clean up EVPN NLRIs dissection.
Do the NLRI length checks in the switch cases for each route type, and
do them for *all* route types, rather than throwing a random check in
for one particular route type.

There is no need to fail up front for unknown route types; at least
dissect the type and length, and fail in the switch statement.

Dissect the route descriptor in each of the switch cases, after the
length check, rather than doing it up front.

Add a comment noting where the prefix route type comes from.

Change-Id: Iae26ecd467d4b36dbcf52e7998bd2881405281aa
Reviewed-on: https://code.wireshark.org/review/19774
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 03:42:42 +00:00
Guy Harris 2e01a94028 That field is a route type, not an address family identifier.
Change-Id: I547dd12479b9634d8176eca9fd2ae6c9e1f87981
Reviewed-on: https://code.wireshark.org/review/19772
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 01:30:27 +00:00
Guy Harris 61de3e581f Clean up and update list of RFCs and I-Ds supported.
Change-Id: Ided8496b1d57a7906c805bca4ed848903d553721
Reviewed-on: https://code.wireshark.org/review/19771
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 00:51:23 +00:00
Guy Harris 7c014c044e Update comment, clean up identation.
Change-Id: I30812657e3fa5dc21e64ed2fb7605e5f2a36ab03
Reviewed-on: https://code.wireshark.org/review/19770
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 00:40:55 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Arjen Zonneveld 79babc6f22 Add BGP dissector support for draft-ietf-idr-shutdown-01
Parse the communication bits of a BGP Cease NOTIFICATION:

Border Gateway Protocol - NOTIFICATION Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 146
    Type: NOTIFICATION Message (3)
    Major error Code: Cease (6)
    Minor error Code (Cease): Administratively Shutdown (2)
    BGP Shutdown Communication Length: 124
    Shutdown Communication: NTT will perform maintenance on this router. This is tracked in TICKET-1-24824294. Contact noc@ntt.net for more information.

Draft at https://tools.ietf.org/html/draft-ietf-idr-shutdown-01, sample
file taken from from http://instituut.net/~job/shutdown.pcap

Change-Id: I2ab633883cc69e560ff79cb6239e02fcffd71e10
Reviewed-on: https://code.wireshark.org/review/19144
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
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-12-13 08:59:30 +00:00
Dario Lombardo 4a3a6b1bbb bgp: remove dead code (CID 1158699).
Change-Id: Ib7f766819bb81858fa0c3a0b49fe39de7123bf6d
Reviewed-on: https://code.wireshark.org/review/18908
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-21 22:49:21 +00:00
Uli Heilmeier de5580a8ff BGP: Fix length in decode_prefix4()
When decode_prefix4() gets called with more prefixes the length of
proto_tree_add_subtree_format() should not be the total length.

As the "Withdrawn route" part was the only one where decode_prefix4() has
been called with a tlen not equal 0 we can eliminate the tlen parameter.

Bug: 13146
Change-Id: I708dec2cecbed6054b60190104b82c72d54e8037
Reviewed-on: https://code.wireshark.org/review/18852
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-11-17 06:49:57 +00:00
Arjen Zonneveld 021c79bdf7 Add BGP dissector support for draft-heitz-idr-large-community-04
Parses large communities as specified in https://tools.ietf.org/html/draft-heitz-idr-large-community-04
        Path Attribute - LARGE_COMMUNITY: 65536:1:1 65536:1:2 65536:1:3
            Flags: 0xc0, Optional, Transitive: Optional, Transitive, Complete
                1... .... = Optional: Optional
                .1.. .... = Transitive: Transitive
                ..0. .... = Partial: Complete
                ...0 .... = Length: Regular length
            Type Code: LARGE_COMMUNITY (32)
            Length: 36
            Large communities: 65536:1:1
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 1
            Large communities: 65536:1:2
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 2
            Large communities: 65536:1:3
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 3

Bug: 13083
Change-Id: I8db0601f621ceb6fb2e170ed9bfc2747091495ee
Reviewed-on: https://code.wireshark.org/review/18172
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-11-02 00:35:52 +00:00
Alexis La Goutte 9796e811f5 BGP: fix bgp.ls.tlv.link_protection_type_value is not of an FT_{U}INTn type]
Bug: 13021
Change-Id: I3464c7af61323efb25dd89655865d536aeae6e59
Reviewed-on: https://code.wireshark.org/review/18261
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
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-18 13:49:57 +00:00
Guy Harris 40e43f7a13 Note the registry for the bgp_l2vpn_encaps values.
Change-Id: Id8ccf81c08d84124e1d7361ce6e87080fa6b440d
Reviewed-on: https://code.wireshark.org/review/18128
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-09 07:10:21 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Peter Palúch 0850c1f1db BGP: Support for Cost, EIGRP and OSPF extended communities
Bug: 12891
Change-Id: I70ed7f8a08122c559128b8df4d65e03be8201e1a
Reviewed-on: https://code.wireshark.org/review/17683
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Palúch <Peter.Paluch@fri.uniza.sk>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-26 05:00:28 +00:00
Peter Palúch f01190ca90 Reworked dissection of BGP Extended Community attributes
This patch contains a partial rewrite of the BGP dissector for Extended
Communities.  The changes were primarily motivated by my dissatisfaction
with the generally unreadable way in which the types, names and values of
BGP Extended Communities were displayed in Wireshark GUI.  The rewrite
provides a hopefully more readable and eye-pleasing way of displaying the
extended communities.  I have also corrected numerous other flaws with the
Extended Community dissector I stumbled across.

In particular, the changes encompass the following:

1.) The Type octet of an Extended Community is now analyzed including its
Authority and Transitivity bits.  These were not dissected before.

2.) Dissection for EVPN Extended Community was improved.  The original
implementation blindly assumed that there is just a single subtype and
decoded the community ignoring the actual subtype.

3.) I have removed the hf_bgp_ext_com_value_unknown16 and ..._unknown32.
The current code uses a different approach to display values of unrecognized
communities, and for recognized communities, there are no "unknown"
subfields.

4.) Removed a couple of variables declared at the
dissect_bgp_update_ext_com() level.  These stored the result of a
tvb_get_...() call but the value was used only once.  I have replaced them
with the direct use of tvb_get_...()

5.) Moved duplicate code to add the Type value into the community_tree from
each branch in the switch(com_type_high_byte) out of it and placed it before
the switch().

6.) Reworked the style in which individual communities are displayed.  Each
community item (collapsed) is now displayed using the following label
format:

Community name: Values [Generic community type]

Examples:

Route Target: 1:1 [Transitive 2-Octet AS-Specific]
Unknown subtype 0x01: 0x8081 0x0000 0x2800 [Non-Transitive Opaque]
Unknown type 0x88 subtype 0x00: 0x0000 0x0000 0x0000 [Unknown community]

6.) To keep the filter names more consistent, changed names of selected filters:

bgp.ext_com.type_high -> bgp.ext_com.type
bgp.ext_com.type_low -> bgp.ext_com.stype_unknown

In particular, I do not want to call the subtype as bgp.ext_com.type_low
because that filter applied only to unrecognized subtypes even though its
name would suggest to users that they can filter any community based on it.

7.) Numerous corrections in text labels, names and labels that have been
incorrect or incomplete.

Bug: 12794
Change-Id: I9653dbbc8a8f85d0cd2753dd12fd537f0a604cf3
Reviewed-on: https://code.wireshark.org/review/17377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-02 19:59:30 +00:00
Alexis La Goutte d0e4e5259f BGP: Add no supported AFI/SAFI (Cisco) Open Message Error
Bug:12601
Change-Id: I555ee8097ea81e1afa8f2f5b2aba8fce60742016
Reviewed-on: https://code.wireshark.org/review/17107
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-18 02:16:32 +00:00
Dario Lombardo f0befede8b bgp: remove dead code (CID 1228878).
afi can take only one of the 2 above values, according to the
check at the beginning of the function.

Change-Id: I6652a5c64b4fbc8d2e907afb3b4f66d187ff9745
Reviewed-on: https://code.wireshark.org/review/17011
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
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-08-12 11:36:51 +00:00
Alexis La Goutte d860d5a74b BGP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Iaec85cbe8fbced461a56f55f8813506054356369
Reviewed-on: https://code.wireshark.org/review/16688
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: Anders Broman <a.broman58@gmail.com>
2016-07-26 11:31:02 +00:00
Matt Texier d3ce757de0 MP-BGP dissector: Fix EVPN route type 5 decoding
Route type 5 do have optional fields that was not properly decoded (MPLS labels)

Bug: 12631
Change-Id: I12d61ef170d4e0f6e6d2c7bf25f149db84c186d7
Reviewed-on: https://code.wireshark.org/review/16576
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-07-26 04:02:03 +00:00
Alexis La Goutte f2584b230a BGP: Add support of Vendor Capability 131 (Multisession Cisco)
Issue reported by Garri Djavadyan

Change-Id: I6dd4bd20d82a3f2cb8aa45f740f72d33e33053da
Ping-Bug:12604
Reviewed-on: https://code.wireshark.org/review/16374
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-07-10 21:32:48 +00:00
Alexis La Goutte 393207582f BGP: Add (Cisco) for "Vendor" Cisco capability
* Route Refresh Cisco capability (128)
* ORF Cisco capability (130)

Issue reported by Garri Djavadyan

Bug: 12605
Change-Id: Icb19cd6a75315e5af4772dd7833a5b762bdd7ff4
Reviewed-on: https://code.wireshark.org/review/16373
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-10 21:32:06 +00:00
Dario Lombardo 1eea415a52 bgp: add return check (CID 1354417).
Change-Id: Id8be1d5f6346686087d747167ec44df2b88dd35e
Reviewed-on: https://code.wireshark.org/review/16304
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: Dario Lombardo <lomato@gmail.com>
2016-07-05 21:39:18 +00:00
Matt Texier 1f28e683f9 BGP: Fixed an side effect of length coding on offset
Bug: 12568
Change-Id: Ibf063293041d749664f6e6ecd2455024ea3fd4ed
Reviewed-on: https://code.wireshark.org/review/16237
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-07-02 14:15:17 +00:00
Matt Texier e55eaf573b BGP dissector: Fixing NLRI length for flow spec NLRI
Bug: 12568
Change-Id: Id2b89c2d133865771e21acf3ee224f57ac9d262b
Reviewed-on: https://code.wireshark.org/review/16203
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-06-30 05:39:44 +00:00
Jim Young 4b66b32fb3 Resolve false positive ERROR: NO ARRAY found in ei array entries
The enhanced checkhf.pl in https://code.wireshark.org/review/#/c/15717/
validates ei items in addition to href items.   This patch addresses the
false positive ERRORS reported by the enhanced checkhf.pl for a "cosmetic"
issue (missing space after { in ei array entries).

Change-Id: I87876ce2cfa4b0e11cb22f457bd9ab025d939e5c
Reviewed-on: https://code.wireshark.org/review/15739
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-05 22:31:37 +00:00
Alexis La Goutte 46dd8a0aa4 BGP : Add Virtual-Network Identifier Extended Community
From draft-drao-bgp-l3vpn-virtual-network-overlays

Change-Id: I0a0137b6a8b8fbb4b4efd6f5e08eba5ed6d7a9d6
Reviewed-on: https://code.wireshark.org/review/15477
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-18 14:32:52 +00:00
Francesco Fondelli 1c862d2584 BGP-LS: fix Prefix-SID parsing, add SR-Capabilities and SR-Algorithm
dissection.

- 20 *rightmost* bits of the 'SID/Label' field represent
  a MPLS label (Adjacency-SID already fixed).
- Add support for SR-Capabilities (TLV 1034) and SR-Algorithm
  (TLV 1035) dissection (draft-gredler-idr-bgp-ls-segment-routing-ext-01).

Change-Id: Ib02137f1c41c4a201afee5d61cf2b6bf88d59991
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/15306
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-05-10 13:47:07 +00:00
Uli Heilmeier 48b807a364 BGP: Fix detection of additional path
When additional path index are in use there must be more remaining data bytes.
Therefore we return only 1 when the len is greater 1.

Bug has been reported by Garri.

Bug: 12240
Change-Id: Ia24311dcedc450e4208df875bc254c9744dec5dd
Reviewed-on: https://code.wireshark.org/review/14396
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-03-08 17:43:43 +00:00
Francesco Fondelli 5d00f39d10 BGP-LS: Protocol-ID aware Prefix/Adj Flags dissection
BGP-LS is just a collector of IGP link state information. Some
fields are encoded "as-is" from the IGP, hence in order to dissect
them properly we must be aware of their origin, e.g. IS-IS or OSPF.
So, *before* dissecting LINK_STATE attributes we must get the
'Protocol-ID' field that is present in the MP_[UN]REACH_NLRI
attribute. The tricky thing is that there is no strict order for path
attributes on the wire, hence we have to keep track of 1) the
'Protocol-ID' from the MP_[UN]REACH_NLRI and 2) the offset/len of
the LINK_STATE attribute. We store them in per-packet proto_data and
once we got both we are ready for the LINK_STATE attribute dissection.

Change-Id: Ibe2b7f5c9039ad63a72f3f9fb8a9c33c0be44ed0
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13970
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-23 13:08:38 +00:00
Francesco Fondelli ec70af4b6a BGP-LS: fix Adjacency-SID parsing
if length is set to 7 then the 20 *rightmost* bits of
the 'SID/Label/Index' field represent a MPLS label.

Change-Id: If196af244549b75a80de11c1d8e11507e9a6ce58
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13848
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-10 07:34:06 +00:00
Francesco Fondelli dfc9f0b038 BGP-LS: fix 'TE Default Metric TLV' and 'IGP Metric TLV' length
parsing

Change-Id: I55d0b435ae1b12e14a20dd9ea18ba05188b0e378
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13666
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-02 22:59:24 +00:00
Francesco Fondelli c7798d608c BGP: Link-State extensions for Segment Routing as per
draft-gredler-idr-bgp-ls-segment-routing-ext-01

Bug: 12060
Change-Id: I53c837ac5c195bdee716a48d8494633b663e751d
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13579
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-01 17:48:45 +00:00
Peter Wu bf0f5a982b Use result of register_dissector
Assign result of `register_dissector(..., func, proto)` to FOO_handle
and remove `FOO_handle = create_dissector_handle(func, proto)`.

Found by looking for files named packet-FOO.c having the above
create_dissector_handle pattern. Some files (with different dissect
routines for the two functions) remain unchanged.

Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90
Reviewed-on: https://code.wireshark.org/review/13247
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-13 11:36:29 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
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-08 20:04:56 +00:00
Guy Harris 32f9f92487 Rename ipv4_addr and ipv6_addr to indicate their full contents.
They're not just addresses, they also include a mask length for IPv4 and
a prefix length for IPv6.  Rename them appropriately.

Rename the old ipv4_addr_and_mask() and ipv6_addr_and_mask() to reflect
that 1) they fetch data from a tvbuff and 2) *don't* fetch the mask
length or prefix length, those lengths are passed as arguments to
indicate how many bytes worth of address to fetch.

Change-Id: I4cad5a186ad7bfcb60022a91dbe8bc8479e6471f
Reviewed-on: https://code.wireshark.org/review/13035
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-04 00:03:34 +00:00
Stig Bjørlykke e1ed7598ee Removed local definitions of offsetof().
The offsetof() macro is an ANSI C library feature.

Change-Id: I2ac91b0b4c94c6f6baf14133b076fdc5ed2e182b
Reviewed-on: https://code.wireshark.org/review/12707
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-18 05:49:45 +00:00
Alexis La Goutte 9c47cb4254 Fix Recurring check found by PVS Studio (V571)
packet-ncp2222.inc: The 'ncp_rec->func == 0x59' condition was already verified in line 7300.
packet-bgp: The 'nlri_len < 21' condition was already verified in line 3879
packet-rtp.c: The 'p_conv_data' condition was already verified in line 1460

Change-Id: I65299718b26454596e3f25665d413a17a99e4ce0
Reviewed-on: https://code.wireshark.org/review/12341
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-11 05:13:54 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Matt Texier d0cde7b8e2 BGP: fix some issue
Fixing ESI Label extended community
Fixing PMSI label field decoding on 20 bits
Fixing inclusive multicast Ethernet tag route
Fixing Ethernet segment route

Bug: 11650
Change-Id: Ifadcc3099f681a5c9480d1ccdd50b29ef4c0069f
Reviewed-on: https://code.wireshark.org/review/12430
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-12-05 12:04:24 +00:00