https://github.com/torvalds/linux
Revision 750a8f3e8f64654a584e54038c2c8db380813c79 authored by NeilBrown on 28 October 2006, 17:38:31 UTC, committed by Linus Torvalds on 28 October 2006, 18:30:51 UTC
A recent fix which made sure ->degraded was initialised properly exposed a
second bug - ->degraded wasn't been updated when drives failed or were
hot-added.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 01ab566
Raw File
Tip revision: 750a8f3e8f64654a584e54038c2c8db380813c79 authored by NeilBrown on 28 October 2006, 17:38:31 UTC
[PATCH] md: fix up maintenance of ->degraded in multipath
Tip revision: 750a8f3
nf_conntrack_l3proto_generic.c
/*
 * (C) 2003,2004 USAGI/WIDE Project <http://www.linux-ipv6.org>
 *
 * Based largely upon the original ip_conntrack code which
 * had the following copyright information:
 *
 * (C) 1999-2001 Paul `Rusty' Russell
 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Author:
 *	Yasuyuki Kozakai @USAGI	<yasuyuki.kozakai@toshiba.co.jp>
 */

#include <linux/types.h>
#include <linux/ip.h>
#include <linux/netfilter.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/icmp.h>
#include <linux/sysctl.h>
#include <net/ip.h>

#include <linux/netfilter_ipv4.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_protocol.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
#include <net/netfilter/nf_conntrack_core.h>
#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>

#if 0
#define DEBUGP printk
#else
#define DEBUGP(format, args...)
#endif

DECLARE_PER_CPU(struct nf_conntrack_stat, nf_conntrack_stat);

static int generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff,
				struct nf_conntrack_tuple *tuple)
{
	memset(&tuple->src.u3, 0, sizeof(tuple->src.u3));
	memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3));

	return 1;
}

static int generic_invert_tuple(struct nf_conntrack_tuple *tuple,
			   const struct nf_conntrack_tuple *orig)
{
	memset(&tuple->src.u3, 0, sizeof(tuple->src.u3));
	memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3));

	return 1;
}

static int generic_print_tuple(struct seq_file *s,
			    const struct nf_conntrack_tuple *tuple)
{
	return 0;
}

static int generic_print_conntrack(struct seq_file *s,
				const struct nf_conn *conntrack)
{
	return 0;
}

static int
generic_prepare(struct sk_buff **pskb, unsigned int hooknum,
		unsigned int *dataoff, u_int8_t *protonum)
{
	/* Never track !!! */
	return -NF_ACCEPT;
}


static u_int32_t generic_get_features(const struct nf_conntrack_tuple *tuple)
				
{
	return NF_CT_F_BASIC;
}

struct nf_conntrack_l3proto nf_conntrack_generic_l3proto = {
	.l3proto	 = PF_UNSPEC,
	.name		 = "unknown",
	.pkt_to_tuple	 = generic_pkt_to_tuple,
	.invert_tuple	 = generic_invert_tuple,
	.print_tuple	 = generic_print_tuple,
	.print_conntrack = generic_print_conntrack,
	.prepare	 = generic_prepare,
	.get_features	 = generic_get_features,
};
back to top