PERFORCE change 127253 for review
Fredrik Lindberg
fli at FreeBSD.org
Sat Oct 6 10:12:20 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=127253
Change 127253 by fli at 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 */
}
More information about the p4-projects
mailing list