Re: crap, i think LKD3 explains linked list head nodes incorrectly ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  ah, a perfect example of how a linked list head node must *not* be
treated as a normal node, in net/sctp/associola.c:

        while (1) {
                /* Skip the head. */
                if (pos->next == head)
                        pos = head->next;
                else
                        pos = pos->next;
                ... snip ...

  that makes it painfully obvious -- an infinite linked list iteration
loop, which *explicitly* checks for the head node each time and has to
jump over it to avoid processing it.  i suspect i'll have to write a
decent tutorial on linked lists one of these days.  in my copious free
time. :-)

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux