summaryrefslogtreecommitdiff
path: root/server/dispatch.c
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-07-29 14:53:39 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-07-29 14:53:39 +0000
commit8ec76c0921175e45602d490cfa696eab781ac87a (patch)
treeaa73ca2871b19990cbe490d438fe886287719016 /server/dispatch.c
parentc57cb726d8889f9bafa558698d98376485900034 (diff)
Factor out code that extacts a sockaddr_in from a notice (and stop using the
deprecated sender_addr macro.) Actually remove the code from realm.c:real_dispatch because nothing was using the result. Ran nuke-trailing-whitespace on all the files I touched, as usual.
Diffstat (limited to 'server/dispatch.c')
-rw-r--r--server/dispatch.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/server/dispatch.c b/server/dispatch.c
index 888790e..40a870d 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -195,10 +195,7 @@ handle_packet(void)
/* we need to parse twice--once to get
the source addr, second to check
authentication */
- memset(&input_sin, 0, sizeof(input_sin));
- input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr;
- input_sin.sin_port = new_notice.z_port;
- input_sin.sin_family = AF_INET;
+ notice_extract_address(&new_notice, &input_sin);
/* Should check to see if packet is from another realm's server,
or a client */
from_server = 1;
@@ -1020,8 +1017,7 @@ control_dispatch(ZNotice_t *notice,
zdbug((LOG_DEBUG, "ctl_disp: opc=%s", opcode));
- newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
- newwho.sin_port = notice->z_port;
+ notice_extract_address(notice, &newwho);
realm = realm_which_realm(&newwho);
if (realm)
return(realm_control_dispatch(notice, auth, who, server, realm));