[ovs-dev] [xlate v1 15/18] lacp: Handle unknown slaves in lacp_process_packet().

Ethan Jackson ethan at nicira.com
Tue Jun 25 01:59:29 UTC 2013


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 at nicira.com>
---
 lib/lacp.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/lacp.c b/lib/lacp.c
index 9daca3b..9faeead 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -279,6 +279,10 @@ lacp_process_packet(struct lacp *lacp, const void *slave_,
     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);
-- 
1.7.9.5




More information about the dev mailing list