From: Ben Pfaff Date: Tue, 11 Nov 2008 22:03:31 +0000 (-0800) Subject: Verify in fwd_port_input() that we are not passed packets that are shared. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae0af9b03d7f20e318a0b9e9846a74137104d8cf;p=openvswitch Verify in fwd_port_input() that we are not passed packets that are shared. --- diff --git a/datapath/forward.c b/datapath/forward.c index b3c2f7af..7c6c1cae 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -68,6 +68,7 @@ int run_flow_through_tables(struct sw_chain *chain, struct sk_buff *skb, void fwd_port_input(struct sw_chain *chain, struct sk_buff *skb, struct net_bridge_port *p) { + WARN_ON_ONCE(skb_shared(skb)); if (run_flow_through_tables(chain, skb, p)) dp_output_control(chain->dp, skb, fwd_save_skb(skb), chain->dp->miss_send_len, diff --git a/datapath/linux-2.4/compat-2.4/include/asm/bug.h b/datapath/linux-2.4/compat-2.4/include/asm/bug.h new file mode 100644 index 00000000..b475d7e9 --- /dev/null +++ b/datapath/linux-2.4/compat-2.4/include/asm/bug.h @@ -0,0 +1,17 @@ +#ifndef _ASM_GENERIC_BUG_H +#define _ASM_GENERIC_BUG_H + +#include + +#define WARN_ON_ONCE(condition) ({ \ + static int __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once) && !__warned) { \ + WARN_ON(1); \ + __warned = 1; \ + } \ + unlikely(__ret_warn_once); \ +}) + +#endif diff --git a/datapath/linux-2.4/compat-2.4/include/linux/kernel.h b/datapath/linux-2.4/compat-2.4/include/linux/kernel.h index 543ba9b6..a6fc906d 100644 --- a/datapath/linux-2.4/compat-2.4/include/linux/kernel.h +++ b/datapath/linux-2.4/compat-2.4/include/linux/kernel.h @@ -3,6 +3,7 @@ #include_next #include +#include /** * container_of - cast a member of a structure out to the containing structure