SMTP: allow multiple TCP ports/ranges to be registered
authorMartin Mathieson <martin.r.mathieson@googlemail.com>
Mon, 15 May 2017 13:52:26 +0000 (14:52 +0100)
committerAnders Broman <a.broman58@gmail.com>
Wed, 17 May 2017 16:54:33 +0000 (16:54 +0000)
Change-Id: Ie470f6b2ffbdc156a1756466826ef6f42e54b8be
Reviewed-on: https://code.wireshark.org/review/21666
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.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>
epan/dissectors/packet-smtp.c

index 6e6f852cca6934e30547b5a10c9ba435ec2595b9..344ffca1185ba0a1e40aca1fb49f7414c1dc9a21 100644 (file)
@@ -42,7 +42,7 @@
 #include "packet-ssl-utils.h"
 
 /* RFC 2821 */
-#define TCP_PORT_SMTP      25
+#define TCP_PORT_SMTP      "25"
 #define TCP_PORT_SSL_SMTP 465
 
 /* RFC 4409 */
@@ -1306,7 +1306,7 @@ proto_register_smtp(void)
 void
 proto_reg_handoff_smtp(void)
 {
-  dissector_add_uint_with_preference("tcp.port", TCP_PORT_SMTP, smtp_handle);
+  dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_SMTP, smtp_handle);
   ssl_dissector_add(TCP_PORT_SSL_SMTP, smtp_handle);
   /* No "auto" preference since handle is shared with SMTP */
   dissector_add_uint("tcp.port", TCP_PORT_SUBMISSION, smtp_handle);