projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sflow: Avoid division by zero if sampling rate is 0.
[openvswitch]
/
datapath
/
dp_notify.c
diff --git
a/datapath/dp_notify.c
b/datapath/dp_notify.c
index f22d8b342f1b1b3d88d19132a2ad88d83feaec56..d5a274981f9ea077ab91b570e3fe35b838bc4c5e 100644
(file)
--- a/
datapath/dp_notify.c
+++ b/
datapath/dp_notify.c
@@
-11,7
+11,7
@@
#include <linux/netdevice.h>
#include "datapath.h"
#include <linux/netdevice.h>
#include "datapath.h"
-
+#include "dp_dev.h"
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
@@
-20,7
+20,12
@@
static int dp_device_event(struct notifier_block *unused, unsigned long event,
struct net_bridge_port *p;
struct datapath *dp;
struct net_bridge_port *p;
struct datapath *dp;
- p = dev->br_port;
+ if (is_dp_dev(dev)) {
+ struct dp_dev *dp_dev = dp_dev_priv(dev);
+ p = dp_dev->dp->ports[dp_dev->port_no];
+ } else {
+ p = dev->br_port;
+ }
if (!p)
return NOTIFY_DONE;
dp = p->dp;
if (!p)
return NOTIFY_DONE;
dp = p->dp;