From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v3] conf, tcp, udp: Allow specification of interface to bind to
Date: Tue, 11 Oct 2022 13:59:38 +0200 [thread overview]
Message-ID: <20221011135938.52903640@elisabeth> (raw)
In-Reply-To: <Y0S9VI/U1lnqUeIx@yekko>
On Tue, 11 Oct 2022 11:48:20 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Tue, Oct 11, 2022 at 01:32:20AM +0200, Stefano Brivio wrote:
>
> > [...]
> >
> > @@ -231,6 +231,14 @@ static int conf_ports(const struct ctx *c, char optname, const char *optarg,
> > if (optname != 't' && optname != 'u')
> > goto bad;
> >
> > + if ((ifname = strchr(buf, '%'))) {
> > + if (spec - ifname >= IFNAMSIZ - 1)
> > + goto bad;
> > +
> > + *ifname = 0;
> > + ifname++;
> > + }
> > +
> > if (inet_pton(AF_INET, buf, addr))
> > af = AF_INET;
> > else if (inet_pton(AF_INET6, buf, addr))
> > @@ -278,9 +286,9 @@ static int conf_ports(const struct ctx *c, char optname, const char *optarg,
> > bitmap_set(fwd->map, i);
> >
> > if (optname == 't')
> > - tcp_sock_init(c, 0, af, addr, i);
> > + tcp_sock_init(c, 0, af, addr, NULL, i);
> > else if (optname == 'u')
> > - udp_sock_init(c, 0, af, addr, i);
> > + udp_sock_init(c, 0, af, addr, NULL, i);
>
> AFAICT nothing prevents specifying an interface with the exclude only
> case, in which case shouldn't you also be passing ifname here?
Right, good catch, I'll fix that.
--
Stefano
prev parent reply other threads:[~2022-10-11 11:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 23:32 [PATCH v3] conf, tcp, udp: Allow specification of interface to bind to Stefano Brivio
2022-10-11 0:48 ` David Gibson
2022-10-11 11:59 ` Stefano Brivio [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=20221011135938.52903640@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).