[krbdev.mit.edu #6868] SVN Commit

Greg Hudson via RT rt-comment at krbdev.mit.edu
Sun Feb 13 16:14:01 EST 2011


Restructure the locate_kdc and sendto_kdc code to defer getaddrinfo
calls until we need the answer.  This requires many changes:

* struct addrlist is now called struct serverlist, and is declared in
  os-proto.h instead of k5-int.h.  It contains an array of struct
  server_entry structures which can hold either a name or an address.
  (Address entries are used for locate_kdc module results.)

* The connection state list is now a linked list, and holds address
  information directly instead of using a struct addrinfo (this
  simplifies memory management).  Each connection entry contains a
  callback buffer (previously stored in a separate array) and an index
  into the server list.

* The {addrstate} trace formatting primitive is no longer needed, and
  has been replaced by {connstate}.  There is also a new tracing event
  for resolving hostnames.

* locate_server, locate_kdc, free_serverlist, and sendto get their
  prefixes changed from krb5int_ to k5_ as their prototypes were being
  adjusted anyway.  The family argument is gone from the locate
  functions as it was never productively used.  k5_sendto now receives
  the socket types of interest.

* krb5_sendto_kdc will now pass a 0 socktype to k5_locate_kdc if both
  socket types are wanted.  There were some allowances for this in
  locate but this was never previously done.  In order to be
  conservative when invoking locate modules, we always pass an
  explicit socktype, thus calling lookup twice (as we did before,
  albeit with a separate init/fini cycle) in the common case.  When
  creating hostname entries in serverlist from profile configuration,
  we preserve the 0 value of socktype, and later create both TCP and
  UDP addresses from the getaddrinfo results when the host is
  resolved.

* Some accessor functions previously used by libkrb4 have been removed
  as they impinged upon this work.


http://src.mit.edu/fisheye/changelog/krb5/?cs=24635
Commit By: ghudson
Revision: 24635
Changed Files:
U   trunk/src/include/cm.h
U   trunk/src/include/k5-int.h
U   trunk/src/include/k5-trace.h
U   trunk/src/lib/krb5/libkrb5.exports
U   trunk/src/lib/krb5/os/accessor.c
U   trunk/src/lib/krb5/os/changepw.c
U   trunk/src/lib/krb5/os/hst_realm.c
U   trunk/src/lib/krb5/os/locate_kdc.c
U   trunk/src/lib/krb5/os/os-proto.h
U   trunk/src/lib/krb5/os/sendto_kdc.c
U   trunk/src/lib/krb5/os/t_locate_kdc.c
U   trunk/src/lib/krb5/os/t_std_conf.c
U   trunk/src/lib/krb5/os/trace.c




More information about the krb5-bugs mailing list