summaryrefslogtreecommitdiff
path: root/zhm
diff options
context:
space:
mode:
authorGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-02-16 17:40:13 -0500
committerGravatar Karl Ramm <kcr@1ts.org>2013-02-16 21:51:43 -0500
commit3a81b9732b089c7431013d02a99c911b9241e6ca (patch)
tree32ef86542276867d6de3ef65d2e4915cee6e8599 /zhm
parent75d881db99b0f32b86c6ab94ed9045dde1237c33 (diff)
zhm: Don't destroy auth on retransmit
When retransmitting a notice after a timeout, just send the original packet instead of reformatting the notice, which destroys new-style authenticators. This fixes #92
Diffstat (limited to 'zhm')
-rw-r--r--zhm/queue.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/zhm/queue.c b/zhm/queue.c
index 993e131..20679b0 100644
--- a/zhm/queue.c
+++ b/zhm/queue.c
@@ -23,6 +23,7 @@ typedef struct _Queue {
int retries;
ZNotice_t notice;
void *packet;
+ int len;
struct sockaddr_in reply;
struct _Queue *next, **prev_p;
} Queue;
@@ -76,6 +77,7 @@ add_notice_to_queue(ZNotice_t *notice,
return(ZERR_NONOTICE);
}
memcpy(entry->packet, packet, Z_MAXPKTLEN);
+ entry->len = len;
if (ZParseNotice(entry->packet, len, &entry->notice) != ZERR_NONE) {
syslog(LOG_ERR, "ZParseNotice failed, but succeeded before");
free(entry->packet);
@@ -144,7 +146,7 @@ retransmit_queue(struct sockaddr_in *sin)
DPR2("\tz_opcode: %s\n", entry->notice.z_opcode);
DPR2("\tz_sender: %s\n", entry->notice.z_sender);
DPR2("\tz_recip: %s\n", entry->notice.z_recipient);
- ret = send_outgoing(&entry->notice);
+ ret = ZSendPacket(entry->packet, entry->len, 0);
if (ret != ZERR_NONE) {
Zperr(ret);
com_err("queue", ret, "sending raw notice");
@@ -251,7 +253,7 @@ queue_timeout(void *arg)
DPR2("\tz_opcode: %s\n", entry->notice.z_opcode);
DPR2("\tz_sender: %s\n", entry->notice.z_sender);
DPR2("\tz_recip: %s\n", entry->notice.z_recipient);
- ret = send_outgoing(&entry->notice);
+ ret = ZSendPacket(entry->packet, entry->len, 0);
if (ret != ZERR_NONE) {
Zperr(ret);
com_err("queue", ret, "sending raw notice");