* [PATCH iproute2 v4] vxlan: Allow setting destination to unicast address.
@ 2013-04-16 12:57 Atzm Watanabe
2013-04-18 22:53 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Atzm Watanabe @ 2013-04-16 12:57 UTC (permalink / raw)
To: netdev
Cc: Stephen Hemminger, David Miller, Ben Hutchings, David Stevens,
Mike Rapoport
This patch allows setting VXLAN destination to unicast address.
It allows that VXLAN can be used as peer-to-peer tunnel without
multicast.
v4: replace "group" with "remote" based by David Stevens's comments.
v3: move a new attribute REMOTE into the last of an enum list
based by Stephen Hemminger's comments.
fix the usage to show explicitly that both "remote" and "group"
cannot be specified, based by Ben Hutchings's comments.
v2: use a new argument "remote" instead of "group" based by
Stephen Hemminger's comments.
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
---
include/linux/if_link.h | 2 +-
ip/iplink_vxlan.c | 21 +++++++++------------
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 40167af..7064f27 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -293,7 +293,7 @@ enum macvlan_mode {
enum {
IFLA_VXLAN_UNSPEC,
IFLA_VXLAN_ID,
- IFLA_VXLAN_GROUP,
+ IFLA_VXLAN_REMOTE,
IFLA_VXLAN_LINK,
IFLA_VXLAN_LOCAL,
IFLA_VXLAN_TTL,
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 1025326..371731e 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -23,7 +23,7 @@
static void explain(void)
{
- fprintf(stderr, "Usage: ... vxlan id VNI [ group ADDR ] [ local ADDR ]\n");
+ fprintf(stderr, "Usage: ... vxlan id VNI [ remote ADDR ] [ local ADDR ]\n");
fprintf(stderr, " [ ttl TTL ] [ tos TOS ] [ dev PHYS_DEV ]\n");
fprintf(stderr, " [ port MIN MAX ] [ [no]learning ]\n");
fprintf(stderr, " [ [no]proxy ] [ [no]rsc ]\n");
@@ -41,7 +41,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
__u32 vni = 0;
int vni_set = 0;
__u32 saddr = 0;
- __u32 gaddr = 0;
+ __u32 daddr = 0;
unsigned link = 0;
__u8 tos = 0;
__u8 ttl = 0;
@@ -63,12 +63,9 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
vni >= 1u << 24)
invarg("invalid id", *argv);
vni_set = 1;
- } else if (!matches(*argv, "group")) {
+ } else if (!matches(*argv, "remote")) {
NEXT_ARG();
- gaddr = get_addr32(*argv);
-
- if (!IN_MULTICAST(ntohl(gaddr)))
- invarg("invald group address", *argv);
+ daddr = get_addr32(*argv);
} else if (!matches(*argv, "local")) {
NEXT_ARG();
if (strcmp(*argv, "any"))
@@ -161,8 +158,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
return -1;
}
addattr32(n, 1024, IFLA_VXLAN_ID, vni);
- if (gaddr)
- addattr_l(n, 1024, IFLA_VXLAN_GROUP, &gaddr, 4);
+ if (daddr)
+ addattr_l(n, 1024, IFLA_VXLAN_REMOTE, &daddr, 4);
if (saddr)
addattr_l(n, 1024, IFLA_VXLAN_LOCAL, &saddr, 4);
if (link)
@@ -206,10 +203,10 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
vni = rta_getattr_u32(tb[IFLA_VXLAN_ID]);
fprintf(f, "id %u ", vni);
- if (tb[IFLA_VXLAN_GROUP]) {
- __be32 addr = rta_getattr_u32(tb[IFLA_VXLAN_GROUP]);
+ if (tb[IFLA_VXLAN_REMOTE]) {
+ __be32 addr = rta_getattr_u32(tb[IFLA_VXLAN_REMOTE]);
if (addr)
- fprintf(f, "group %s ",
+ fprintf(f, "remote %s ",
format_host(AF_INET, 4, &addr, s1, sizeof(s1)));
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2 v4] vxlan: Allow setting destination to unicast address.
2013-04-16 12:57 [PATCH iproute2 v4] vxlan: Allow setting destination to unicast address Atzm Watanabe
@ 2013-04-18 22:53 ` Stephen Hemminger
2013-04-19 13:07 ` Atzm Watanabe
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2013-04-18 22:53 UTC (permalink / raw)
To: Atzm Watanabe
Cc: netdev, David Miller, Ben Hutchings, David Stevens, Mike Rapoport
On Tue, 16 Apr 2013 21:57:15 +0900
Atzm Watanabe <atzm@stratosphere.co.jp> wrote:
> diff --git a/include/linux/if_link.h b/include/linux/if_link.h
> index 40167af..7064f27 100644
> --- a/include/linux/if_link.h
> +++ b/include/linux/if_link.h
> @@ -293,7 +293,7 @@ enum macvlan_mode {
> enum {
> IFLA_VXLAN_UNSPEC,
> IFLA_VXLAN_ID,
> - IFLA_VXLAN_GROUP,
> + IFLA_VXLAN_REMOTE,
> IFLA_VXLAN_LINK,
> IFLA_VXLAN_LOCAL,
> IFLA_VXLAN_TTL,
This doesn't match header in kernel.
Don't worry, I won't merge the 3.10 (current net-next) stuff until
after 3.10 merge window, and first step is to update headers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2 v4] vxlan: Allow setting destination to unicast address.
2013-04-18 22:53 ` Stephen Hemminger
@ 2013-04-19 13:07 ` Atzm Watanabe
0 siblings, 0 replies; 3+ messages in thread
From: Atzm Watanabe @ 2013-04-19 13:07 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, David Miller, Ben Hutchings, David Stevens, Mike Rapoport
At Thu, 18 Apr 2013 15:53:06 -0700,
Stephen Hemminger wrote:
>
> On Tue, 16 Apr 2013 21:57:15 +0900
> Atzm Watanabe <atzm@stratosphere.co.jp> wrote:
>
> > diff --git a/include/linux/if_link.h b/include/linux/if_link.h
> > index 40167af..7064f27 100644
> > --- a/include/linux/if_link.h
> > +++ b/include/linux/if_link.h
> > @@ -293,7 +293,7 @@ enum macvlan_mode {
> > enum {
> > IFLA_VXLAN_UNSPEC,
> > IFLA_VXLAN_ID,
> > - IFLA_VXLAN_GROUP,
> > + IFLA_VXLAN_REMOTE,
> > IFLA_VXLAN_LINK,
> > IFLA_VXLAN_LOCAL,
> > IFLA_VXLAN_TTL,
>
> This doesn't match header in kernel.
> Don't worry, I won't merge the 3.10 (current net-next) stuff until
> after 3.10 merge window, and first step is to update headers.
OK, thanks.
I shall wait for the upstream.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-19 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 12:57 [PATCH iproute2 v4] vxlan: Allow setting destination to unicast address Atzm Watanabe
2013-04-18 22:53 ` Stephen Hemminger
2013-04-19 13:07 ` Atzm Watanabe
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).