• Kuniyuki Iwashima's avatar
    tcp: Add selftest for bind() and TIME_WAIT. · 2c042e8e
    Kuniyuki Iwashima authored
    bhash2 split the bind() validation logic into wildcard and non-wildcard
    cases.  Let's add a test to catch future regression.
    
    Before the previous patch:
    
      # ./bind_timewait
      TAP version 13
      1..2
      # Starting 2 tests from 3 test cases.
      #  RUN           bind_timewait.localhost.1 ...
      # bind_timewait.c:87:1:Expected ret (0) == -1 (-1)
      # 1: Test terminated by assertion
      #          FAIL  bind_timewait.localhost.1
      not ok 1 bind_timewait.localhost.1
      #  RUN           bind_timewait.addrany.1 ...
      #            OK  bind_timewait.addrany.1
      ok 2 bind_timewait.addrany.1
      # FAILED: 1 / 2 tests passed.
      # Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
    
    After:
    
      # ./bind_timewait
      TAP version 13
      1..2
      # Starting 2 tests from 3 test cases.
      #  RUN           bind_timewait.localhost.1 ...
      #            OK  bind_timewait.localhost.1
      ok 1 bind_timewait.localhost.1
      #  RUN           bind_timewait.addrany.1 ...
      #            OK  bind_timewait.addrany.1
      ok 2 bind_timewait.addrany.1
      # PASSED: 2 / 2 tests passed.
      # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
    Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
    Acked-by: default avatarJoanne Koong <joannelkoong@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2c042e8e
bind_timewait.c 1.79 KB