summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGravatar Chaskiel Grundman <cg2v@andrew.cmu.edu>2011-11-16 23:52:14 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2011-11-18 05:05:33 -0500
commitf276622ace757977fec43633e43577350e0cf6fe (patch)
tree9777a7e8447f35f58e02958e15171142e9d7cf46 /server
parent0a98bdce2ca346588356cf53f82287ae410b49ea (diff)
realm_auth_sendit_nacked fixups
In addition to the packet length problem discussed last night, the realm_auth_sendit_nacked refactor also had a cut-n-paste error. In the unfragmented case, it passed in partnotice.z_uid instead of newnotice.z_uid. In that branch of the if, partnotice is uninitialized... My (derrick's) servers are no longer constantly complaining (in new debug code) that realm_nack_cancel couldn't find the nack to dequeue, so I think I'm done with this problem.
Diffstat (limited to 'server')
-rw-r--r--server/realm.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/server/realm.c b/server/realm.c
index 56bd71e..dd50ad4 100644
--- a/server/realm.c
+++ b/server/realm.c
@@ -930,8 +930,7 @@ realm_sendit(ZNotice_t *notice,
return;
}
- nacked->client = NULL;
- nacked->rexmits = 0;
+ memset(nacked, 0, sizeof(Unacked));
nacked->packet = pack;
nacked->dest.rlm.rlm_idx = realm - otherrealms;
nacked->dest.rlm.rlm_srv_idx = realm->idx;
@@ -1059,7 +1058,7 @@ realm_dump_realms(FILE *fp)
#ifdef HAVE_KRB5
static Code_t
-realm_auth_sendit_nacked(char *buffer, ZRealm *realm,
+realm_auth_sendit_nacked(char *buffer, int packlen, ZRealm *realm,
ZUnique_Id_t uid, int ack_to_sender,
struct sockaddr_in *who)
{
@@ -1069,11 +1068,11 @@ realm_auth_sendit_nacked(char *buffer, ZRealm *realm,
if (nacked == NULL)
return ENOMEM;
- nacked->rexmits = 0;
+ memset(nacked, 0, sizeof(Unacked));
nacked->packet = buffer;
nacked->dest.rlm.rlm_idx = realm - otherrealms;
nacked->dest.rlm.rlm_srv_idx = realm->idx;
- nacked->packsz = sizeof(ZPacket_t);
+ nacked->packsz = packlen;
nacked->uid = uid;
/* Do the ack for the last frag, below */
@@ -1215,7 +1214,8 @@ realm_sendit_auth(ZNotice_t *notice,
}
if (!retval) {
- retval = realm_auth_sendit_nacked(buffer, realm,
+ retval = realm_auth_sendit_nacked(buffer, hdrlen +
+ partnotice.z_message_len,realm,
partnotice.z_uid,
ack_to_sender, who);
if (retval) /* no space: just punt */
@@ -1240,8 +1240,9 @@ realm_sendit_auth(ZNotice_t *notice,
syslog(LOG_WARNING, "rlm_sendit_auth xmit: %s",
error_message(retval));
else {
- retval = realm_auth_sendit_nacked(buffer, realm,
- partnotice.z_uid,
+ retval = realm_auth_sendit_nacked(buffer,
+ hdrlen + newnotice.z_message_len,
+ realm, newnotice.z_uid,
ack_to_sender, who);
if (retval) /* no space: just punt */
syslog(LOG_ERR, "rlm_sendit_auth: realm_auth_sendit_nacked: %s",