git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8d19e7a
)
Stopgap fix for bug #478, where kernel panics on SNAT to input port.
author
Ben Pfaff
<blp@nicira.com>
Tue, 11 Nov 2008 01:45:23 +0000
(17:45 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Tue, 11 Nov 2008 01:45:23 +0000
(17:45 -0800)
datapath/dp_dev.c
patch
|
blob
|
history
diff --git
a/datapath/dp_dev.c
b/datapath/dp_dev.c
index
ee66638
..
9bf4bf5
100644
(file)
--- a/
datapath/dp_dev.c
+++ b/
datapath/dp_dev.c
@@
-57,10
+57,23
@@
static int dp_dev_mac_addr(struct net_device *dev, void *p)
return 0;
}
return 0;
}
-static int dp_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
+static int dp_dev_xmit(struct sk_buff *
o
skb, struct net_device *netdev)
{
struct dp_dev *dp_dev = dp_dev_priv(netdev);
struct datapath *dp = dp_dev->dp;
{
struct dp_dev *dp_dev = dp_dev_priv(netdev);
struct datapath *dp = dp_dev->dp;
+ struct sk_buff *skb;
+
+ /* FIXME: doing a full copy here is far too expensive and most the time
+ * it is unnecessary. However, it is a stopgap fix for bug #478. */
+ skb = skb_copy(oskb, GFP_ATOMIC);
+ skb->dev = oskb->dev;
+ kfree_skb(oskb);
+ if (!skb) {
+ if (net_ratelimit()) {
+ printk("failed to copy skb destined for dp_dev\n");
+ }
+ return 0;
+ }
dp_dev->stats.tx_packets++;
dp_dev->stats.tx_bytes += skb->len;
dp_dev->stats.tx_packets++;
dp_dev->stats.tx_bytes += skb->len;