git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev: Clean up and refactor packet receive interface.
[sliver-openvswitch.git]
/
lib
/
dpif-netdev.c
diff --git
a/lib/dpif-netdev.c
b/lib/dpif-netdev.c
index
14b9192
..
fa6b549
100644
(file)
--- a/
lib/dpif-netdev.c
+++ b/
lib/dpif-netdev.c
@@
-350,7
+350,6
@@
do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
/* Open and validate network device. */
memset(&netdev_options, 0, sizeof netdev_options);
netdev_options.name = devname;
/* Open and validate network device. */
memset(&netdev_options, 0, sizeof netdev_options);
netdev_options.name = devname;
- netdev_options.ethertype = NETDEV_ETH_TYPE_ANY;
if (dp->class == &dpif_dummy_class) {
netdev_options.type = "dummy";
} else if (internal) {
if (dp->class == &dpif_dummy_class) {
netdev_options.type = "dummy";
} else if (internal) {
@@
-364,6
+363,14
@@
do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
/* XXX reject loopback devices */
/* XXX reject non-Ethernet devices */
/* XXX reject loopback devices */
/* XXX reject non-Ethernet devices */
+ error = netdev_listen(netdev);
+ if (error) {
+ VLOG_ERR("%s: cannot receive packets on this network device (%s)",
+ devname, strerror(errno));
+ netdev_close(netdev);
+ return error;
+ }
+
error = netdev_turn_flags_on(netdev, NETDEV_PROMISC, false);
if (error) {
netdev_close(netdev);
error = netdev_turn_flags_on(netdev, NETDEV_PROMISC, false);
if (error) {
netdev_close(netdev);