Skip to content

Commit

Permalink
fea: Fix crash when mcast_protocol_fd_in returns NULL.
Browse files Browse the repository at this point in the history
This was seen on freebsd box, not sure why exactly it's
returning NULL yet, but at the least, shouldn't deref
the NULL and crash.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Oct 3, 2011
1 parent 603d301 commit 92998c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -17,7 +17,6 @@
// XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/fea/data_plane/managers/fea_data_plane_manager_click.hh,v 1.11 2008/10/02 21:57:12 bms Exp $

#ifndef __FEA_DATA_PLANE_MANAGERS_FEA_DATA_PLANE_MANAGER_CLICK_HH__
#define __FEA_DATA_PLANE_MANAGERS_FEA_DATA_PLANE_MANAGER_CLICK_HH__
Expand Down
10 changes: 6 additions & 4 deletions xorp/fea/io_ip_manager.cc
Expand Up @@ -704,13 +704,15 @@ IoIpComm::first_valid_mcast_protocol_fd_in()
IoIpPlugins::iterator iter;
for (iter = _io_ip_plugins.begin(); iter != _io_ip_plugins.end(); ++iter) {
IoIp* io_ip = iter->second;
xorp_fd = *(io_ip->mcast_protocol_fd_in());
if (xorp_fd.is_valid())
return (xorp_fd);
XorpFd* xfd = io_ip->mcast_protocol_fd_in();
if (xfd && xfd->is_valid()) {
xorp_fd = *xfd;
return xorp_fd;
}
}

// XXX: nothing found
return (xorp_fd);
return xorp_fd;
}

// ----------------------------------------------------------------------------
Expand Down

0 comments on commit 92998c5

Please sign in to comment.