]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async/dpdk: fix SEGV caused by zero length packet
authorChunsong Feng <fengchunsong@huawei.com>
Wed, 20 Nov 2019 05:56:50 +0000 (13:56 +0800)
committerluo rixin <luorixin@huawei.com>
Tue, 26 Nov 2019 09:09:07 +0000 (17:09 +0800)
calculating zero length packet checksum will cause segv,
so skip sending the packet here.

Fixes: https://tracker.ceph.com/issues/42805
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
src/msg/async/dpdk/DPDKStack.h

index e41a87545220ee81fbd4de4d1c5f19f372646dd6..65e089c67447e1181e4e6299f34443f828294e65 100644 (file)
@@ -141,6 +141,11 @@ class NativeConnectedSocketImpl : public ConnectedSocketImpl {
     uint64_t seglen = 0;
     while (len < available && left_pbrs--) {
       seglen = pb->length();
+      // Buffer length is zero, no need to send, so skip it
+      if (seglen == 0) {
+        ++pb;
+        continue;
+      }
       if (len + seglen > available) {
         // don't continue if we enough at least 1 fragment since no available
         // space for next ptr.