netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] ipset: fix lookup of tcp port names
Date: Sat, 29 Oct 2011 16:48:55 +0200	[thread overview]
Message-ID: <20111029164855.28a93cb6@s6510.linuxnetplumber.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1110282224490.3090@blackhole.kfki.hu>

On Fri, 28 Oct 2011 22:26:36 +0200 (CEST)
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> wrote:

> Hi Stephen,
> 
> On Fri, 28 Oct 2011, Stephen Hemminger wrote:
> 
> > The protocol argument to getservbyname() must be lowercase tcp not
> > uppercase TCP. This fixes the bug observed by:
> > 
> >  # ipset add foo http
> >  ipset v6.9.1: Syntax error: 'http' is invalid as number
> >  Syntax error: cannot parse 'http' as a TCP port
> > ---
> >  lib/parse.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/parse.c b/lib/parse.c
> > index 241d5ae..3ca702c 100644
> > --- a/lib/parse.c
> > +++ b/lib/parse.c
> > @@ -307,7 +307,7 @@ int
> >  ipset_parse_tcp_port(struct ipset_session *session,
> >  		     enum ipset_opt opt, const char *str)
> >  {
> > -	return ipset_parse_tcpudp_port(session, opt, str, "TCP");
> > +	return ipset_parse_tcpudp_port(session, opt, str, "tcp");
> >  }
> >  
> >  /**
> > @@ -330,7 +330,7 @@ ipset_parse_single_tcp_port(struct ipset_session *session,
> >  	assert(opt == IPSET_OPT_PORT || opt == IPSET_OPT_PORT_TO);
> >  	assert(str);
> >  
> > -	return ipset_parse_port(session, opt, str, "TCP");
> > +	return ipset_parse_port(session, opt, str, "tcp");
> >  }
> >  
> >  /**
> > -- 
> > 1.7.2.5
> 
> Ohh, thanks! Somehow port names haven't been tested by the testsuite....

Luckly they were by our regression testsuite.


      reply	other threads:[~2011-10-29 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 16:16 [PATCH] ipset: fix lookup of tcp port names Stephen Hemminger
2011-10-28 20:26 ` Jozsef Kadlecsik
2011-10-29 14:48   ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111029164855.28a93cb6@s6510.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).