• Kuniyuki Iwashima's avatar
    selftest: af_unix: Add SO_OOBINLINE test cases in msg_oob.c · 436352e8
    Kuniyuki Iwashima authored
    When SO_OOBINLINE is enabled on a socket, MSG_OOB can be recv()ed
    without MSG_OOB flag, and ioctl(SIOCATMARK) will behaves differently.
    
    This patch adds some test cases for SO_OOBINLINE.
    
    Note the new test cases found two bugs in TCP.
    
      1) After reading OOB data with non-inline mode, we can re-read
         the data by setting SO_OOBINLINE.
    
      #  RUN           msg_oob.no_peek.inline_oob_ahead_break ...
      # msg_oob.c:146:inline_oob_ahead_break:AF_UNIX :world
      # msg_oob.c:147:inline_oob_ahead_break:TCP     :oworld
      #            OK  msg_oob.no_peek.inline_oob_ahead_break
      ok 14 msg_oob.no_peek.inline_oob_ahead_break
    
      2) The head OOB data is dropped if SO_OOBINLINE is disabled
         if a new OOB data is queued.
    
      #  RUN           msg_oob.no_peek.inline_ex_oob_drop ...
      # msg_oob.c:171:inline_ex_oob_drop:AF_UNIX :x
      # msg_oob.c:172:inline_ex_oob_drop:TCP     :y
      # msg_oob.c:146:inline_ex_oob_drop:AF_UNIX :y
      # msg_oob.c:147:inline_ex_oob_drop:TCP     :Resource temporarily unavailable
      #            OK  msg_oob.no_peek.inline_ex_oob_drop
      ok 17 msg_oob.no_peek.inline_ex_oob_drop
    Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    436352e8
msg_oob.c 8.29 KB