struct rx_cache_entry {
uint32_t callnum; /* Call number (net order) */
- struct in_addr client; /* client IP address (net order) */
- struct in_addr server; /* server IP address (net order) */
+ uint32_t client; /* client IP address (net order) */
+ uint32_t server; /* server IP address (net order) */
u_int dport; /* server port (host order) */
uint16_t serviceId; /* Service identifier (net order) */
uint32_t opcode; /* RX opcode (host order) */
rx_cache_next = 0;
rxent->callnum = GET_BE_U_4(rxh->callNumber);
- UNALIGNED_MEMCPY(&rxent->client, ip->ip_src, sizeof(uint32_t));
- UNALIGNED_MEMCPY(&rxent->server, ip->ip_dst, sizeof(uint32_t));
+ rxent->client = GET_IPV4_TO_NETWORK_ORDER(ip->ip_src);
+ rxent->server = GET_IPV4_TO_NETWORK_ORDER(ip->ip_dst);
rxent->dport = dport;
rxent->serviceId = GET_BE_U_2(rxh->serviceId);
rxent->opcode = GET_BE_U_4(bp + sizeof(struct rx_header));
uint32_t clip;
uint32_t sip;
- UNALIGNED_MEMCPY(&clip, ip->ip_dst, sizeof(uint32_t));
- UNALIGNED_MEMCPY(&sip, ip->ip_src, sizeof(uint32_t));
+ clip = GET_IPV4_TO_NETWORK_ORDER(ip->ip_dst);
+ sip = GET_IPV4_TO_NETWORK_ORDER(ip->ip_src);
/* Start the search where we last left off */
do {
rxent = &rx_cache[i];
if (rxent->callnum == GET_BE_U_4(rxh->callNumber) &&
- rxent->client.s_addr == clip &&
- rxent->server.s_addr == sip &&
+ rxent->client == clip &&
+ rxent->server == sip &&
rxent->serviceId == GET_BE_U_2(rxh->serviceId) &&
rxent->dport == sport) {
acl & PRSFS_ADMINISTER ? "a" : "");
for (i = 0; i < pos; i++) {
- nd_snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
+ snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
if (sscanf((char *) s, fmt, user, &acl, &n) != 2)
goto finish;
s += n;
}
for (i = 0; i < neg; i++) {
- nd_snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
+ snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
if (sscanf((char *) s, fmt, user, &acl, &n) != 2)
goto finish;
s += n;
}
/*
- * Otherwise, print out "yes" it it was a beacon packet (because
+ * Otherwise, print out "yes" if it was a beacon packet (because
* that's how yes votes are returned, go figure), otherwise
* just print out the error code.
*/