Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2005 17:19:22 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/netinet ip_output.c
Message-ID:  <200508091719.j79HJMj9046703@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
rwatson     2005-08-09 17:19:22 UTC

  FreeBSD src repository

  Modified files:
    sys/netinet          ip_output.c 
  Log:
  Add helper function ip_findmoptions(), which accepts an inpcb, and attempts
  to atomically return either an existing set of IP multicast options for the
  PCB, or a newlly allocated set with default values.  The inpcb is returned
  locked.  This function may sleep.
  
  Call ip_moptions() to acquire a reference to a PCB's socket options, and
  perform the update of the options while holding the PCB lock.  Release the
  lock before returning.
  
  Remove garbage collection of multicast options when values return to the
  default, as this complicates locking substantially.  Most applications
  allocate a socket either to be multicast, or not, and don't tend to keep
  around sockets that have previously been used for multicast, then used for
  unicast.
  
  This closes a number of race conditions involving multiple threads or
  processes modifying the IP multicast state of a socket simultaenously.
  
  MFC after:      7 days
  
  Revision  Changes    Path
  1.244     +58 -33    src/sys/netinet/ip_output.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508091719.j79HJMj9046703>