[sslh] [PATCH 05/10] Enable the PROBE_AGAIN return code
ondra+sslh at mistotebe.net
ondra+sslh at mistotebe.net
Tue Sep 24 00:30:35 CEST 2013
From: Ondřej Kuzník <ondra at mistotebe.net>
---
probe.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/probe.c b/probe.c
index 0bff2be..aef8f1d 100644
--- a/probe.c
+++ b/probe.c
@@ -125,7 +125,7 @@ void hexdump(const char *mem, unsigned int len)
static int is_ssh_protocol(const char *p, int len, struct proto *proto)
{
if (len < 4)
- return PROBE_NEXT;
+ return PROBE_AGAIN;
return !strncmp(p, "SSH-", 4);
}
@@ -145,7 +145,7 @@ static int is_openvpn_protocol (const char*p,int len, struct proto *proto)
int packet_len;
if (len < 2)
- return PROBE_NEXT;
+ return PROBE_AGAIN;
packet_len = ntohs(*(uint16_t*)p);
return packet_len == len - 2;
@@ -157,7 +157,7 @@ static int is_openvpn_protocol (const char*p,int len, struct proto *proto)
static int is_tinc_protocol( const char *p, int len, struct proto *proto)
{
if (len < 2)
- return PROBE_NEXT;
+ return PROBE_AGAIN;
return !strncmp(p, "0 ", 2);
}
@@ -169,7 +169,7 @@ static int is_tinc_protocol( const char *p, int len, struct proto *proto)
static int is_xmpp_protocol( const char *p, int len, struct proto *proto)
{
if (len < 6)
- return PROBE_NEXT;
+ return PROBE_AGAIN;
return memmem(p, len, "jabber", 6) ? 1 : 0;
}
@@ -177,7 +177,7 @@ static int is_xmpp_protocol( const char *p, int len, struct proto *proto)
static int probe_http_method(const char *p, int len, const char *opt)
{
if (len < strlen(opt))
- return PROBE_NEXT;
+ return PROBE_AGAIN;
return !strncmp(p, opt, len);
}
@@ -211,7 +211,7 @@ static int is_http_protocol(const char *p, int len, struct proto *proto)
static int is_tls_protocol(const char *p, int len, struct proto *proto)
{
if (len < 3)
- return PROBE_NEXT;
+ return PROBE_AGAIN;
/* TLS packet starts with a record "Hello" (0x16), followed by version
* (0x03 0x00-0x03) (RFC6101 A.1)
--
1.8.4.rc3
More information about the sslh
mailing list