From 2a022fb7174939a80d51936325f6af562ad5a85f Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 21 Feb 2012 15:59:00 +0100 Subject: conntrackd: allow using lower/upper case in ExpectationSync You can use: ExpectationSync { ftp ras q.931 sip } or: ExpectationSync { FTP RAS Q.931 SIP } no matter lower/upper case. Signed-off-by: Pablo Neira Ayuso --- src/filter.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/filter.c') diff --git a/src/filter.c b/src/filter.c index afefbfa..39dd4ca 100644 --- a/src/filter.c +++ b/src/filter.c @@ -1,6 +1,7 @@ /* - * (C) 2006-2008 by Pablo Neira Ayuso - * + * (C) 2006-2012 by Pablo Neira Ayuso + * (C) 2011-2012 by Vyatta Inc + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -449,7 +450,7 @@ int exp_filter_add(struct exp_filter *f, const char *helper_name) return -1; list_for_each_entry(item, &f->list, head) { - if (strncmp(item->helper_name, helper_name, + if (strncasecmp(item->helper_name, helper_name, NFCT_HELPER_NAME_MAX) == 0) { return -1; } @@ -475,7 +476,7 @@ int exp_filter_find(struct exp_filter *f, const struct nf_expect *exp) const char *name = nfexp_get_attr(exp, ATTR_EXP_HELPER_NAME); /* we allow partial matching to support things like sip-PORT. */ - if (strncmp(item->helper_name, name, + if (strncasecmp(item->helper_name, name, strlen(item->helper_name)) == 0) { return 1; } -- cgit v1.2.3