From owner-p4-projects@FreeBSD.ORG Sat Oct 6 17:12:20 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 74BAF16A419; Sat, 6 Oct 2007 17:12:20 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1780716A41B for ; Sat, 6 Oct 2007 17:12:20 +0000 (UTC) (envelope-from fli@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F3FC013C44B for ; Sat, 6 Oct 2007 17:12:19 +0000 (UTC) (envelope-from fli@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l96HCJ0P007505 for ; Sat, 6 Oct 2007 17:12:19 GMT (envelope-from fli@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l96HCJZw007502 for perforce@freebsd.org; Sat, 6 Oct 2007 17:12:19 GMT (envelope-from fli@FreeBSD.org) Date: Sat, 6 Oct 2007 17:12:19 GMT Message-Id: <200710061712.l96HCJZw007502@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fli@FreeBSD.org using -f From: Fredrik Lindberg To: Perforce Change Reviews Cc: Subject: PERFORCE change 127253 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2007 17:12:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=127253 Change 127253 by fli@fli_nexus on 2007/10/06 17:12:19 - Add missing ntohs() when reading port. - Remove a duplicated line. - Add a missing dbr_find_end() - Wrong variable was set to 0 (minimum delay calculation) Affected files ... .. //depot/projects/soc2007/fli-mdns_sd/mdnsd/input.c#3 edit Differences ... ==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/input.c#3 (text+ko) ==== @@ -149,7 +149,7 @@ else if (hdr->h_cquestion > 1) min2 = (random() % 101) + 20; else - min = 0; + min2 = 0; /* * Process the question section @@ -183,6 +183,7 @@ dprintf(DEBUG_SEND, "Record %s found in " "database, but is not marked ok (%x)", qs.q_name, dr->dr_flags); + dbr_find_end(&mif->mif_dbr); continue; } @@ -208,7 +209,6 @@ * Loop through matching (class, type) pairs from our * database and construct responses. */ - ds = dbr_find(&mif->mif_dbr, qs.q_name, qs.q_class, qs.q_type); while (ds != NULL) { if (hdr->h_canswer > 0) { cr = cache_find(&ac, qs.q_name, @@ -357,23 +357,20 @@ #ifdef DEBUG char addr[SOCK_MAXADDRLEN+1]; #endif - struct aqueue *aq; switch (from->sa_family) { case AF_INET: sin = (struct sockaddr_in *)from; - port = sin->sin_port; + port = ntohs(sin->sin_port); sinaddr = &((struct sockaddr_in *)from)->sin_addr; sinaddr_len = sizeof(struct in_addr); - aq = &mif->mif_aq4; break; #ifdef INET6 case AF_INET6: sin6 = (struct sockaddr_in6 *)from; - port = sin6->sin6_port; + port = ntohs(sin6->sin6_port); sinaddr = &((struct sockaddr_in6 *)from)->sin6_addr; sinaddr_len = sizeof(struct in6_addr); - aq = &mif->mif_aq6; break; #endif /* INET6 */ }