2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

dpif-linux: Fix the return type of dpif_linux_port_dump_next__().

Commit 222837 (dpif-linux: Factor out port dumping helper functions.)
introduced a bug by making dpif_linux_port_dump_next__() return 'bool'
instead of 'int' as defined in dpif-provider.h.  This bug causes ovs-
vswitchd failure with SEGFAULT when processing slow-path packet.

This commit fixes the bug by following the dpif-provider specification.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Alex Wang
2013-12-17 14:37:09 -08:00
committed by Ben Pfaff
parent a8d819675f
commit 7c1ef244f0

View File

@@ -739,7 +739,7 @@ dpif_linux_port_dump_start(const struct dpif *dpif, void **statep)
return 0;
}
static bool
static int
dpif_linux_port_dump_next__(const struct dpif *dpif_, struct nl_dump *dump,
struct dpif_linux_vport *vport)
{
@@ -1300,7 +1300,7 @@ dpif_linux_refresh_channels(struct dpif *dpif_)
dpif->n_events = dpif->event_offset = 0;
dpif_linux_port_dump_start__(dpif_, &dump);
while (dpif_linux_port_dump_next__(dpif_, &dump, &vport)) {
while (!dpif_linux_port_dump_next__(dpif_, &dump, &vport)) {
uint32_t port_no = odp_to_u32(vport.port_no);
struct nl_sock *sock = (port_no < dpif->uc_array_size
? dpif->channels[port_no].sock