* [PATCH iproute2 net-next 0/2] Extend ip address command to enable multicast group join/leave on IP level @ 2015-03-04 18:30 Madhu Challa 2015-03-04 18:30 ` [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN Madhu Challa 2015-03-04 18:30 ` [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level Madhu Challa 0 siblings, 2 replies; 6+ messages in thread From: Madhu Challa @ 2015-03-04 18:30 UTC (permalink / raw) To: stephen, netdev; +Cc: Madhu Challa Extends "ip address" command with autojoin keyword Madhu Challa (2): Header rebase for IFA_F_MCAUTOJOIN Enable configuring multicast group join / leave at IP level. include/linux/if_addr.h | 1 + ip/ipaddress.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN 2015-03-04 18:30 [PATCH iproute2 net-next 0/2] Extend ip address command to enable multicast group join/leave on IP level Madhu Challa @ 2015-03-04 18:30 ` Madhu Challa 2015-03-15 19:42 ` Stephen Hemminger 2015-03-04 18:30 ` [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level Madhu Challa 1 sibling, 1 reply; 6+ messages in thread From: Madhu Challa @ 2015-03-04 18:30 UTC (permalink / raw) To: stephen, netdev; +Cc: Madhu Challa --- include/linux/if_addr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index cc375e4..2033adc 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h @@ -50,6 +50,7 @@ enum { #define IFA_F_PERMANENT 0x80 #define IFA_F_MANAGETEMPADDR 0x100 #define IFA_F_NOPREFIXROUTE 0x200 +#define IFA_F_MCAUTOJOIN 0x400 struct ifa_cacheinfo { __u32 ifa_prefered; -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN 2015-03-04 18:30 ` [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN Madhu Challa @ 2015-03-15 19:42 ` Stephen Hemminger 0 siblings, 0 replies; 6+ messages in thread From: Stephen Hemminger @ 2015-03-15 19:42 UTC (permalink / raw) To: Madhu Challa; +Cc: netdev On Wed, 4 Mar 2015 10:30:09 -0800 Madhu Challa <challa@noironetworks.com> wrote: > --- > include/linux/if_addr.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h > index cc375e4..2033adc 100644 > --- a/include/linux/if_addr.h > +++ b/include/linux/if_addr.h > @@ -50,6 +50,7 @@ enum { > #define IFA_F_PERMANENT 0x80 > #define IFA_F_MANAGETEMPADDR 0x100 > #define IFA_F_NOPREFIXROUTE 0x200 > +#define IFA_F_MCAUTOJOIN 0x400 > > struct ifa_cacheinfo { > __u32 ifa_prefered; Already picked this up in my net-next branch. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level. 2015-03-04 18:30 [PATCH iproute2 net-next 0/2] Extend ip address command to enable multicast group join/leave on IP level Madhu Challa 2015-03-04 18:30 ` [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN Madhu Challa @ 2015-03-04 18:30 ` Madhu Challa 2015-03-15 19:43 ` Stephen Hemminger 1 sibling, 1 reply; 6+ messages in thread From: Madhu Challa @ 2015-03-04 18:30 UTC (permalink / raw) To: stephen, netdev; +Cc: Madhu Challa Joining multicast group on ethernet level via "ip maddr" command would not work if we have an Ethernet switch that does igmp snooping since the switch would not replicate multicast packets on ports that did not have IGMP reports for the multicast addresses. Linux vxlan interfaces created via "ip link add vxlan" have the group option that enables then to do the required join. By extending ip address command with option "autojoin" we can get similar functionality for openvswitch vxlan interfaces as well as other tunneling mechanisms that need to receive multicast traffic. example: ip address add 224.1.1.10/24 dev eth5 autojoin ip address del 224.1.1.10/24 dev eth5 --- ip/ipaddress.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 99a6ab5..e582da0 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -85,7 +85,7 @@ static void usage(void) fprintf(stderr, " [-]tentative | [-]deprecated | [-]dadfailed | temporary |\n"); fprintf(stderr, " CONFFLAG-LIST ]\n"); fprintf(stderr, "CONFFLAG-LIST := [ CONFFLAG-LIST ] CONFFLAG\n"); - fprintf(stderr, "CONFFLAG := [ home | nodad | mngtmpaddr | noprefixroute ]\n"); + fprintf(stderr, "CONFFLAG := [ home | nodad | mngtmpaddr | noprefixroute | autojoin ]\n"); fprintf(stderr, "LIFETIME := [ valid_lft LFT ] [ preferred_lft LFT ]\n"); fprintf(stderr, "LFT := forever | SECONDS\n"); @@ -915,6 +915,10 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, ifa_flags &= ~IFA_F_NOPREFIXROUTE; fprintf(fp, "noprefixroute "); } + if (ifa_flags & IFA_F_MCAUTOJOIN) { + ifa_flags &= ~IFA_F_MCAUTOJOIN; + fprintf(fp, "autojoin "); + } if (!(ifa_flags & IFA_F_PERMANENT)) { fprintf(fp, "dynamic "); } else @@ -1354,6 +1358,9 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action) } else if (strcmp(*argv, "noprefixroute") == 0) { filter.flags |= IFA_F_NOPREFIXROUTE; filter.flagmask |= IFA_F_NOPREFIXROUTE; + } else if (strcmp(*argv, "autojoin") == 0) { + filter.flags |= IFA_F_MCAUTOJOIN; + filter.flagmask |= IFA_F_MCAUTOJOIN; } else if (strcmp(*argv, "dadfailed") == 0) { filter.flags |= IFA_F_DADFAILED; filter.flagmask |= IFA_F_DADFAILED; @@ -1558,6 +1565,16 @@ static int default_scope(inet_prefix *lcl) return 0; } +static bool ipaddr_is_multicast(inet_prefix *a) +{ + if (a->family == AF_INET) + return IN_MULTICAST(ntohl(a->data[0])); + else if (a->family == AF_INET6) + return IN6_IS_ADDR_MULTICAST(a->data); + else + return false; +} + static int ipaddr_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -1665,6 +1682,8 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) ifa_flags |= IFA_F_MANAGETEMPADDR; } else if (strcmp(*argv, "noprefixroute") == 0) { ifa_flags |= IFA_F_NOPREFIXROUTE; + } else if (strcmp(*argv, "autojoin") == 0) { + ifa_flags |= IFA_F_MCAUTOJOIN; } else { if (strcmp(*argv, "local") == 0) { NEXT_ARG(); @@ -1755,6 +1774,11 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) sizeof(cinfo)); } + if ((ifa_flags & IFA_F_MCAUTOJOIN) && !ipaddr_is_multicast(&lcl)) { + fprintf(stderr, "autojoin needs multicast address\n"); + return -1; + } + if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0) return -2; -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level. 2015-03-04 18:30 ` [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level Madhu Challa @ 2015-03-15 19:43 ` Stephen Hemminger 2015-03-16 17:59 ` Madhu Challa 0 siblings, 1 reply; 6+ messages in thread From: Stephen Hemminger @ 2015-03-15 19:43 UTC (permalink / raw) To: Madhu Challa; +Cc: netdev On Wed, 4 Mar 2015 10:30:10 -0800 Madhu Challa <challa@noironetworks.com> wrote: > Joining multicast group on ethernet level via "ip maddr" command would > not work if we have an Ethernet switch that does igmp snooping since > the switch would not replicate multicast packets on ports that did not > have IGMP reports for the multicast addresses. > > Linux vxlan interfaces created via "ip link add vxlan" have the group option > that enables then to do the required join. > > By extending ip address command with option "autojoin" we can get similar > functionality for openvswitch vxlan interfaces as well as other tunneling > mechanisms that need to receive multicast traffic. > > example: > ip address add 224.1.1.10/24 dev eth5 autojoin > ip address del 224.1.1.10/24 dev eth5 Applied, but please update manual pages as well. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level. 2015-03-15 19:43 ` Stephen Hemminger @ 2015-03-16 17:59 ` Madhu Challa 0 siblings, 0 replies; 6+ messages in thread From: Madhu Challa @ 2015-03-16 17:59 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netdev On Sun, Mar 15, 2015 at 12:43 PM, Stephen Hemminger <stephen@networkplumber.org> wrote: > On Wed, 4 Mar 2015 10:30:10 -0800 > Madhu Challa <challa@noironetworks.com> wrote: > >> Joining multicast group on ethernet level via "ip maddr" command would >> not work if we have an Ethernet switch that does igmp snooping since >> the switch would not replicate multicast packets on ports that did not >> have IGMP reports for the multicast addresses. >> >> Linux vxlan interfaces created via "ip link add vxlan" have the group option >> that enables then to do the required join. >> >> By extending ip address command with option "autojoin" we can get similar >> functionality for openvswitch vxlan interfaces as well as other tunneling >> mechanisms that need to receive multicast traffic. >> >> example: >> ip address add 224.1.1.10/24 dev eth5 autojoin >> ip address del 224.1.1.10/24 dev eth5 > > Applied, but please update manual pages as well. Thanks Stephen. Sure I will. Thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-16 17:59 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-04 18:30 [PATCH iproute2 net-next 0/2] Extend ip address command to enable multicast group join/leave on IP level Madhu Challa 2015-03-04 18:30 ` [PATCH iproute2 net-next 1/2] Header rebase for IFA_F_MCAUTOJOIN Madhu Challa 2015-03-15 19:42 ` Stephen Hemminger 2015-03-04 18:30 ` [PATCH iproute2 net-next 2/2] Enable configuring multicast group join / leave at IP level Madhu Challa 2015-03-15 19:43 ` Stephen Hemminger 2015-03-16 17:59 ` Madhu Challa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox