projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xenserver: Clear stale configuration keys on boot, but not on later starts
[openvswitch]
/
lib
/
dpif-netdev.c
diff --git
a/lib/dpif-netdev.c
b/lib/dpif-netdev.c
index cae6d2319a83a9d1eb4dae5f7116da9e0043a92d..4c25f1393884004b732b107cba4bca8d04c95ed9 100644
(file)
--- a/
lib/dpif-netdev.c
+++ b/
lib/dpif-netdev.c
@@
-23,15
+23,11
@@
#include <fcntl.h>
#include <inttypes.h>
#include <net/if.h>
#include <fcntl.h>
#include <inttypes.h>
#include <net/if.h>
-#include <linux/rtnetlink.h>
-#include <linux/ethtool.h>
-#include <linux/sockios.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/sysmacros.h>
#include <unistd.h>
#include "csum.h"
#include <unistd.h>
#include "csum.h"
@@
-160,7
+156,7
@@
get_dp_netdev(const struct dpif *dpif)
static int
name_to_dp_idx(const char *name)
{
static int
name_to_dp_idx(const char *name)
{
- if (!strncmp(name, "dp", 2) && isdigit(name[2])) {
+ if (!strncmp(name, "dp", 2) && isdigit(
(unsigned char)
name[2])) {
int dp_idx = atoi(name + 2);
if (dp_idx >= 0 && dp_idx < N_DP_NETDEVS) {
return dp_idx;
int dp_idx = atoi(name + 2);
if (dp_idx >= 0 && dp_idx < N_DP_NETDEVS) {
return dp_idx;
@@
-377,7
+373,9
@@
do_add_port(struct dp_netdev *dp, const char *devname, uint16_t flags,
if (!internal) {
error = netdev_open(devname, NETDEV_ETH_TYPE_ANY, &netdev);
} else {
if (!internal) {
error = netdev_open(devname, NETDEV_ETH_TYPE_ANY, &netdev);
} else {
- error = netdev_open_tap(devname, &netdev);
+ char *tapname = xasprintf("tap:%s", devname);
+ error = netdev_open(tapname, NETDEV_ETH_TYPE_ANY, &netdev);
+ free(tapname);
}
if (error) {
return error;
}
if (error) {
return error;
@@
-396,7
+394,7
@@
do_add_port(struct dp_netdev *dp, const char *devname, uint16_t flags,
port->netdev = netdev;
port->internal = internal;
port->netdev = netdev;
port->internal = internal;
-
mtu = netdev_get_mtu(netdev
);
+
netdev_get_mtu(netdev, &mtu
);
if (mtu > max_mtu) {
max_mtu = mtu;
}
if (mtu > max_mtu) {
max_mtu = mtu;
}
@@
-422,7
+420,7
@@
dpif_netdev_port_add(struct dpif *dpif, const char *devname, uint16_t flags,
return do_add_port(dp, devname, flags, port_no);
}
}
return do_add_port(dp, devname, flags, port_no);
}
}
- return E
XFULL
;
+ return E
FBIG
;
}
static int
}
static int
@@
-827,7
+825,7
@@
dpif_netdev_flow_put(struct dpif *dpif, struct odp_flow_put *put)
if (hmap_count(&dp->flow_table) < MAX_FLOWS) {
return add_flow(dpif, &put->flow);
} else {
if (hmap_count(&dp->flow_table) < MAX_FLOWS) {
return add_flow(dpif, &put->flow);
} else {
- return E
XFULL
;
+ return E
FBIG
;
}
} else {
return ENOENT;
}
} else {
return ENOENT;
@@
-890,7
+888,7
@@
dpif_netdev_execute(struct dpif *dpif, uint16_t in_port,
flow_t flow;
int error;
flow_t flow;
int error;
- if (packet->size < ETH_HLEN || packet->size > UINT16_MAX) {
+ if (packet->size < ETH_H
EADER_
LEN || packet->size > UINT16_MAX) {
return EINVAL;
}
return EINVAL;
}
@@
-988,7
+986,7
@@
dp_netdev_flow_used(struct dp_netdev_flow *flow, const flow_t *key,
time_timeval(&flow->used);
flow->packet_count++;
flow->byte_count += packet->size;
time_timeval(&flow->used);
flow->packet_count++;
flow->byte_count += packet->size;
- if (key->dl_type == htons(ETH_
P
_IP)) {
+ if (key->dl_type == htons(ETH_
TYPE
_IP)) {
struct ip_header *nh = packet->l3;
flow->ip_tos = nh->ip_tos;
struct ip_header *nh = packet->l3;
flow->ip_tos = nh->ip_tos;
@@
-1161,7
+1159,7
@@
static void
dp_netdev_set_tp_port(struct ofpbuf *packet, flow_t *key,
const struct odp_action_tp_port *a)
{
dp_netdev_set_tp_port(struct ofpbuf *packet, flow_t *key,
const struct odp_action_tp_port *a)
{
- if (key->dl_type == htons(ETH_
P
_IP)) {
+ if (key->dl_type == htons(ETH_
TYPE
_IP)) {
uint16_t *field;
if (key->nw_proto == IPPROTO_TCP) {
struct tcp_header *th = packet->l4;
uint16_t *field;
if (key->nw_proto == IPPROTO_TCP) {
struct tcp_header *th = packet->l4;