From: Stephen Hemminger <stephen@networkplumber.org>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [RESEND PATCH iproute2] vxlan: add ipv6 support
Date: Mon, 23 Sep 2013 13:20:49 -0700	[thread overview]
Message-ID: <20130923132049.7fa5673e@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1379730924-12433-1-git-send-email-amwang@redhat.com>
On Sat, 21 Sep 2013 10:35:24 +0800
Cong Wang <amwang@redhat.com> wrote:
> +			if (!inet_pton(AF_INET, *argv, &gaddr)) {
> +				if (!inet_pton(AF_INET6, *argv, &gaddr6)) {
> +					fprintf(stderr, "Invalid address \"%s\"\n", *argv);
> +					return -1;
> +				} else if (!IN6_IS_ADDR_MULTICAST(&gaddr6))
> +					invarg("invald group address", *argv);
> +			} else if (!IN_MULTICAST(ntohl(gaddr)))
> +					invarg("invald group address", *argv);
This is ugly, can't it be done more generically by checking for ':' in address.
Or even use getaddrinfo.
Hate to have lots of special code to handle both address types.
next prev parent reply	other threads:[~2013-09-23 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21  2:35 [RESEND PATCH iproute2] vxlan: add ipv6 support Cong Wang
2013-09-23 20:20 ` Stephen Hemminger [this message]
2013-09-24  2:44   ` Cong Wang
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=20130923132049.7fa5673e@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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).