From 8ec76c0921175e45602d490cfa696eab781ac87a Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Wed, 29 Jul 2009 14:53:39 +0000 Subject: 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. --- server/dispatch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'server/dispatch.c') 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)); -- cgit v1.2.3