In future patches, ofproto-dpif-xlate may be temporarily out of
sync with ofproto-dpif proper, and pass an unknown ofport to
lacp_process_packet(). This patch handles that edge case
gracefully.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
const struct lacp_pdu *pdu;
long long int tx_rate;
const struct lacp_pdu *pdu;
long long int tx_rate;
+ if (!slave) {
+ return;
+ }
+
pdu = parse_lacp_packet(packet);
if (!pdu) {
VLOG_WARN_RL(&rl, "%s: received an unparsable LACP PDU.", lacp->name);
pdu = parse_lacp_packet(packet);
if (!pdu) {
VLOG_WARN_RL(&rl, "%s: received an unparsable LACP PDU.", lacp->name);
if (lacp) {
struct slave *slave = slave_lookup(lacp, slave_);
if (lacp) {
struct slave *slave = slave_lookup(lacp, slave_);
+ if (!slave) {
+ return;
+ }
+
if (slave->status == LACP_CURRENT || slave->lacp->active) {
slave_set_expired(slave);
}
if (slave->status == LACP_CURRENT || slave->lacp->active) {
slave_set_expired(slave);
}
lacp_slave_may_enable(const struct lacp *lacp, const void *slave_)
{
if (lacp) {
lacp_slave_may_enable(const struct lacp *lacp, const void *slave_)
{
if (lacp) {
- return slave_may_enable__(slave_lookup(lacp, slave_));
+ struct slave *slave = slave_lookup(lacp, slave_);
+ return slave ? slave_may_enable__(slave) : false;
bool
lacp_slave_is_current(const struct lacp *lacp, const void *slave_)
{
bool
lacp_slave_is_current(const struct lacp *lacp, const void *slave_)
{
- return slave_lookup(lacp, slave_)->status != LACP_DEFAULTED;
+ struct slave *slave = slave_lookup(lacp, slave_);
+ return slave ? slave->status != LACP_DEFAULTED : false;
}
/* This function should be called periodically to update 'lacp'. */
}
/* This function should be called periodically to update 'lacp'. */