cvs commit: src/sys/netgraph netgraph.h ng_base.c ng_socket.c ng_socketvar.h

Gleb Smirnoff glebius at FreeBSD.org
Tue Jul 5 17:35:21 GMT 2005


glebius     2005-07-05 17:35:20 UTC

  FreeBSD src repository

  Modified files:
    sys/netgraph         netgraph.h ng_base.c ng_socket.c 
                         ng_socketvar.h 
  Log:
  In the splnet times, netgraph was functional and synchronous. Nowadays,
  an item may be queued and processed later. While this is OK for mbufs,
  this is a problem for control messages.
  
  In the framework:
  - Add optional callback function pointer to an item. When item gets
    applied the callback is executed from ng_apply_item().
  - Add new flag NG_PROGRESS. If this flag is supplied, then return
    EINPROGRESS instead of 0 in case if item failed to deliver
    synchronously and was queued.
  - Honor NG_PROGRESS in ng_snd_item().
  
  In ng_socket:
  - When userland sends control message add callback to the item.
  - If ng_snd_item() returns EINPROGRESS, then sleep.
  
  This change fixes possible races in ngctl(8) scripts.
  
  Reviewed by:    julian
  Approved by:    re (scottl)
  
  Revision  Changes    Path
  1.55      +8 -0      src/sys/netgraph/netgraph.h
  1.102     +28 -2     src/sys/netgraph/ng_base.c
  1.67      +44 -1     src/sys/netgraph/ng_socket.c
  1.10      +2 -0      src/sys/netgraph/ng_socketvar.h


More information about the cvs-src mailing list