Linux Container Development
 help / color / mirror / Atom feed
From: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: [PATCH 3/3] Fail checkpoint if IPv4 multicast addresses are configured
Date: Tue,  6 Apr 2010 07:13:03 -0700	[thread overview]
Message-ID: <1270563183-9351-4-git-send-email-danms@us.ibm.com> (raw)
In-Reply-To: <1270563183-9351-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

This causes checkpoint to fail if an interface actually has a
multicast membership.

Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 net/checkpoint_dev.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
index 776931b..11c6544 100644
--- a/net/checkpoint_dev.c
+++ b/net/checkpoint_dev.c
@@ -17,6 +17,7 @@
 #include <linux/checkpoint.h>
 #include <linux/checkpoint_hdr.h>
 #include <linux/deferqueue.h>
+#include <linux/igmp.h>
 
 #include <net/if_inet6.h>
 #include <net/ipv6.h>
@@ -177,6 +178,7 @@ static int ckpt_netdev_inet4_addrs(struct in_device *indev,
 				   struct ckpt_netdev_addr *abuf)
 {
 	struct in_ifaddr *addr = indev->ifa_list;
+	struct ip_mc_list *mcaddr;
 
 	while (addr) {
 		abuf[index].type = CKPT_NETDEV_ADDR_IPV4;
@@ -190,6 +192,19 @@ static int ckpt_netdev_inet4_addrs(struct in_device *indev,
 			return -E2BIG;
 	}
 
+	for (mcaddr = indev->mc_list; mcaddr; mcaddr = mcaddr->next) {
+		if ((mcaddr->multiaddr & IGMP_LOCAL_GROUP_MASK) == IGMP_LOCAL_GROUP)
+			continue;
+
+		/* TODO */
+
+		/* Multicast addresses are not supported, so do not
+		 * allow checkpoint to continue if one is assigned
+		 */
+		ckpt_debug("ipv4 multicast addresses are not supported\n");
+		return -EINVAL;
+	}
+
 	return index;
 }
 
-- 
1.6.2.5

      parent reply	other threads:[~2010-04-06 14:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 14:13 c/r: IPv6 support Dan Smith
     [not found] ` <1270563183-9351-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-06 14:13   ` [PATCH 1/3] C/R: Support for IPv6 addresses on network devices (v2) Dan Smith
     [not found]     ` <1270563183-9351-2-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-06 15:53       ` Brian Haley
     [not found]         ` <4BBB58FF.1090908-VXdhtT5mjnY@public.gmane.org>
2010-04-06 16:19           ` Dan Smith
     [not found]             ` <87eiisblkn.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-24 23:15               ` Oren Laadan
2010-04-07  4:18       ` Serge E. Hallyn
     [not found]         ` <20100407041858.GA12287-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-07 14:02           ` Dan Smith
     [not found]             ` <87aatfbbtk.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-07 14:02               ` Serge E. Hallyn
2010-04-06 14:13   ` [PATCH 2/3] C/R: Fix storing IPv6 addresses and handle the "ipv6only" socket flag Dan Smith
     [not found]     ` <1270563183-9351-3-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-06 23:47       ` Serge E. Hallyn
2010-04-06 14:13   ` Dan Smith [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=1270563183-9351-4-git-send-email-danms@us.ibm.com \
    --to=danms-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.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