projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simap: New data structure for string-to-integer maps.
[openvswitch]
/
lib
/
netdev-vport.c
diff --git
a/lib/netdev-vport.c
b/lib/netdev-vport.c
index 77b151d0981161e6d4b55983f971c962085216e6..a9eb3eb14bc5eb24379ca92e288688c45385b777 100644
(file)
--- a/
lib/netdev-vport.c
+++ b/
lib/netdev-vport.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2010, 2011
Nicira Networks
.
+ * Copyright (c) 2010, 2011
, 2012 Nicira, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-198,6
+198,7
@@
netdev_vport_destroy(struct netdev_dev *netdev_dev_)
{
struct netdev_dev_vport *netdev_dev = netdev_dev_vport_cast(netdev_dev_);
{
struct netdev_dev_vport *netdev_dev = netdev_dev_vport_cast(netdev_dev_);
+ ofpbuf_delete(netdev_dev->options);
route_table_unregister();
free(netdev_dev);
}
route_table_unregister();
free(netdev_dev);
}
@@
-458,7
+459,7
@@
netdev_vport_set_stats(struct netdev *netdev, const struct netdev_stats *stats)
}
static int
}
static int
-netdev_vport_get_
status
(const struct netdev *netdev, struct shash *sh)
+netdev_vport_get_
drv_info
(const struct netdev *netdev, struct shash *sh)
{
const char *iface = netdev_vport_get_tnl_iface(netdev);
{
const char *iface = netdev_vport_get_tnl_iface(netdev);
@@
-611,7
+612,12
@@
parse_tunnel_config(const char *name, const char *type,
if (!strcmp(node->data, "inherit")) {
flags |= TNL_F_TOS_INHERIT;
} else {
if (!strcmp(node->data, "inherit")) {
flags |= TNL_F_TOS_INHERIT;
} else {
- nl_msg_put_u8(options, OVS_TUNNEL_ATTR_TOS, atoi(node->data));
+ char *endptr;
+ int tos;
+ tos = strtol(node->data, &endptr, 0);
+ if (*endptr == '\0') {
+ nl_msg_put_u8(options, OVS_TUNNEL_ATTR_TOS, tos);
+ }
}
} else if (!strcmp(node->name, "ttl")) {
if (!strcmp(node->data, "inherit")) {
}
} else if (!strcmp(node->name, "ttl")) {
if (!strcmp(node->data, "inherit")) {
@@
-813,7
+819,7
@@
unparse_tunnel_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED,
smap_add(args, "tos", "inherit");
} else if (a[OVS_TUNNEL_ATTR_TOS]) {
int tos = nl_attr_get_u8(a[OVS_TUNNEL_ATTR_TOS]);
smap_add(args, "tos", "inherit");
} else if (a[OVS_TUNNEL_ATTR_TOS]) {
int tos = nl_attr_get_u8(a[OVS_TUNNEL_ATTR_TOS]);
- shash_add(args, "tos", xasprintf("
%d
", tos));
+ shash_add(args, "tos", xasprintf("
0x%x
", tos));
}
if (flags & TNL_F_CSUM) {
}
if (flags & TNL_F_CSUM) {
@@
-922,7
+928,6
@@
unparse_patch_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED,
\
NULL, /* get_features */ \
NULL, /* set_advertisements */ \
\
NULL, /* get_features */ \
NULL, /* set_advertisements */ \
- NULL, /* get_vlan_vid */ \
\
NULL, /* set_policing */ \
NULL, /* get_qos_types */ \
\
NULL, /* set_policing */ \
NULL, /* get_qos_types */ \
@@
-953,15
+958,15
@@
netdev_vport_register(void)
{
static const struct vport_class vport_classes[] = {
{ OVS_VPORT_TYPE_GRE,
{
static const struct vport_class vport_classes[] = {
{ OVS_VPORT_TYPE_GRE,
- { "gre", VPORT_FUNCTIONS(netdev_vport_get_
status
) },
+ { "gre", VPORT_FUNCTIONS(netdev_vport_get_
drv_info
) },
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_GRE,
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_GRE,
- { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_
status
) },
+ { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_
drv_info
) },
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_CAPWAP,
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_CAPWAP,
- { "capwap", VPORT_FUNCTIONS(netdev_vport_get_
status
) },
+ { "capwap", VPORT_FUNCTIONS(netdev_vport_get_
drv_info
) },
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_PATCH,
parse_tunnel_config, unparse_tunnel_config },
{ OVS_VPORT_TYPE_PATCH,