]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: sdp_recvmsg() shouldn't handle SDP_MID_DISCONN when MSG_PEEK flag is up.
authorEldad Zinger <eldadz@mellanox.co.il>
Mon, 14 Jun 2010 10:03:16 +0000 (13:03 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:03 +0000 (05:05 -0700)
Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index 73db7d0bea7bf96e3d6e2c94f2f1919ec0773459..a631a2517ba49e2a1a138b07536951b0579cf7cb 100644 (file)
@@ -2188,6 +2188,14 @@ static int sdp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 
                        switch (h->mid) {
                        case SDP_MID_DISCONN:
+                               if (flags & MSG_PEEK) {
+                                       /* There is no point of handling a
+                                        * remote disconnection request while
+                                        * MSG_PEEK. The remote disconnection
+                                        * request will be handled upon regular
+                                        * recv. */
+                                       goto got_disconn_in_peek;
+                               }
                                sdp_dbg(sk, "Handle RX SDP_MID_DISCONN\n");
                                sdp_prf(sk, NULL, "Handle RX SDP_MID_DISCONN");
                                sdp_handle_disconn(sk);
@@ -2453,6 +2461,7 @@ found_fin_ok:
 
        } while (len > 0);
 
+got_disconn_in_peek:
        err = copied;
 out: