Re: anyone believe this KASSERT?

From: Ian Dowse (iedowse_at_maths.tcd.ie)
Date: 10/24/03

  • Next message: Dan: "IPFW rules being weird?"
    To: Sam Leffler <sam@errno.com>
    Date: Fri, 24 Oct 2003 01:27:20 +0100
    
    

    In message <200310231441.36966.sam@errno.com>, Sam Leffler writes:
    >uipc_socket.c has a KASSERT in soreceive that I think is wrong. It dates from
    >
    >a long time ago but I can't tell exactly who created it since some
    >intermediate munging buggered the CVS logs.

    It was there in revision 1.1 as:

            m = so->so_rcv.sb_mb;
            ...
            if (m == 0 || (...) &&
                m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0) {
    #ifdef DIAGNOSTIC
                    if (m == 0 && so->so_rcv.sb_cc)
                            panic("receive 1");
    #endif

    Seems to be clearer there except for the lack of brackets around
    the (a && b && c) - it's just saying that if sb_mb is NULL then
    sb_cc should be zero. The current code appears to do the same thing,
    so looks reasonable unless I'm missing something (sb_mb should be
    NULL when there is no data queued shouldn't it?).

    Digging back even further:

    REV:7.13 uipc_socket.c 1989/04/22 12:26:53 sklower

       checkpoint for version to be handed to NIST, simple tp4 connection

    ...
    - if (so->so_rcv.sb_cc == 0) {
    + m = so->so_rcv.sb_mb;
    + if (m == 0) {
    + if (so->so_rcv.sb_cc)
    + panic("receive 1");

    Ian
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Dan: "IPFW rules being weird?"