From 7b46e5958ff7c4d81491c247405dc91eda54f8c8 Mon Sep 17 00:00:00 2001 From: ruti <> Date: Sat, 18 Jan 2025 11:51:11 +0300 Subject: [PATCH] Set l7 proto with l4 #251 --- extend.c | 3 +++ main.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extend.c b/extend.c index 42ccaa3..58e069a 100644 --- a/extend.c +++ b/extend.c @@ -226,6 +226,9 @@ static bool check_l34(struct desync_params *dp, int st, const union sockaddr_u * if ((dp->proto & IS_UDP) && (st != SOCK_DGRAM)) { return 0; } + if ((dp->proto & IS_TCP) && (st != SOCK_STREAM)) { + return 0; + } if (dp->proto & IS_IPV4) { static const char *pat = "\0\0\0\0\0\0\0\0\0\0\xff\xff"; diff --git a/main.c b/main.c index 25dcfec..0ce06c3 100644 --- a/main.c +++ b/main.c @@ -823,10 +823,10 @@ int main(int argc, char **argv) while (end && !invalid) { switch (*end) { case 't': - dp->proto |= IS_HTTPS; + dp->proto |= IS_TCP | IS_HTTPS; break; case 'h': - dp->proto |= IS_HTTP; + dp->proto |= IS_TCP | IS_HTTP; break; case 'u': dp->proto |= IS_UDP;