2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-19 14:37:21 +00:00

dpctl: Fix crash.

ovs-dpctl crashed due to uninitialized router classifier. To
fix this issue move ovs router initialization to route table
module.

Reported-by: Madhu Challa <challa@noironetworks.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Pravin B Shelar
2014-11-19 22:12:21 -08:00
parent d32754b454
commit 1bc50ef389
6 changed files with 7 additions and 6 deletions

View File

@@ -38,6 +38,7 @@
#include "packet-dpif.h"
#include "packets.h"
#include "poll-loop.h"
#include "route-table.h"
#include "shash.h"
#include "sset.h"
#include "timeval.h"
@@ -115,9 +116,11 @@ dp_initialize(void)
dp_register_provider(base_dpif_classes[i]);
}
dpctl_unixctl_register();
ovsthread_once_done(&once);
tnl_port_map_init();
tnl_arp_cache_init();
route_table_register();
ovsthread_once_done(&once);
}
}

View File

@@ -254,8 +254,6 @@ netdev_vport_construct(struct netdev *netdev_)
dev->tnl_cfg.dst_port = htons(LISP_DST_PORT);
}
route_table_register();
return 0;
}

View File

@@ -281,7 +281,7 @@ ovs_router_flush(void)
/* May not be called more than once. */
void
ovs_router_unixctl_register(void)
ovs_router_init(void)
{
classifier_init(&cls, NULL);
unixctl_command_register("ovs/route/add", "ipv4_addr/prefix_len out_br_name gw", 2, 3,

View File

@@ -24,7 +24,7 @@ extern "C" {
#endif
bool ovs_router_lookup(ovs_be32 ip_dst, char out_dev[], ovs_be32 *gw);
void ovs_router_unixctl_register(void);
void ovs_router_init(void);
#ifdef __cplusplus
}
#endif

View File

@@ -96,6 +96,7 @@ route_table_register(void)
ovs_assert(!nln);
ovs_assert(!route_notifier);
ovs_router_init();
nln = nln_create(NETLINK_ROUTE, RTNLGRP_IPV4_ROUTE,
(nln_parse_func *) route_table_parse, &rtmsg);

View File

@@ -1253,7 +1253,6 @@ construct(struct ofproto *ofproto_)
guarded_list_init(&ofproto->pins);
ofproto_unixctl_init();
ovs_router_unixctl_register();
hmap_init(&ofproto->vlandev_map);
hmap_init(&ofproto->realdev_vid_map);