It is essentially an invalid configuration to disable LACP but request TCP balancing: in this configuration, the bond drops all packets. But may_send_learning_packets() would still indicate that learning packets should be sent, so bond_compose_learning_packet() would try to choose an output slave for those packets, which would be NULL (because all packets are dropped), which would cause a segfault upon dereference.
This commit fixes the problem by making may_send_learning_packets() no longer indicate that learning packets should be sent. I tested this issue by modifying bond_should_send_learning_packets() to always return true if may_send_learning_packets() returns true, and then introducing the invalid configuration described above. Without this comit, ovs-vswitchd segfaults quickly; with this commit, it does not. Bug #14090. Reported-by: Kiran Shanbhog <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> --- I tested a similar patch last night, but I modified it a bit since then, so I'll test this final patch again before I apply it. AUTHORS | 1 + lib/bond.c | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/AUTHORS b/AUTHORS index c699998..4f2dba4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -133,6 +133,7 @@ Jeongkeun Lee [email protected] Joan Cirer [email protected] John Galgay [email protected] Kevin Mancuso [email protected] +Kiran Shanbhog [email protected] Kirill Kabardin Koichi Yagishita [email protected] Konstantin Khorenko [email protected] diff --git a/lib/bond.c b/lib/bond.c index 5805294..141c742 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -494,7 +494,7 @@ static bool may_send_learning_packets(const struct bond *bond) { return bond->lacp_status == LACP_DISABLED - && bond->balance != BM_STABLE + && (bond->balance == BM_SLB || bond->balance == BM_AB) && bond->active_slave; } -- 1.7.2.5 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
