switch (IP_V(ip)) {
case 4:
cookiecache[ninitiator].version = 4;
- UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4, &ip->ip_src, sizeof(nd_ipv4));
- UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4, &ip->ip_dst, sizeof(nd_ipv4));
+ UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4,
+ ip->ip_src, sizeof(nd_ipv4));
+ UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4,
+ ip->ip_dst, sizeof(nd_ipv4));
break;
case 6:
ip6 = (const struct ip6_hdr *)bp2;
if (cookiecache[i].version != 4)
return 0;
if (initiator) {
- if (UNALIGNED_MEMCMP(&ip->ip_src, &cookiecache[i].iaddr.in4, sizeof(nd_ipv4)) == 0)
+ if (UNALIGNED_MEMCMP(ip->ip_src, &cookiecache[i].iaddr.in4, sizeof(nd_ipv4)) == 0)
return 1;
} else {
- if (UNALIGNED_MEMCMP(&ip->ip_src, &cookiecache[i].raddr.in4, sizeof(nd_ipv4)) == 0)
+ if (UNALIGNED_MEMCMP(ip->ip_src, &cookiecache[i].raddr.in4, sizeof(nd_ipv4)) == 0)
return 1;
}
break;
UNALIGNED_MEMCPY(&xmep->xid, &rp->rm_xid, sizeof(xmep->xid));
if (ip) {
xmep->ipver = 4;
- UNALIGNED_MEMCPY(&xmep->client, &ip->ip_src, sizeof(ip->ip_src));
- UNALIGNED_MEMCPY(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst));
+ UNALIGNED_MEMCPY(&xmep->client, ip->ip_src,
+ sizeof(ip->ip_src));
+ UNALIGNED_MEMCPY(&xmep->server, ip->ip_dst,
+ sizeof(ip->ip_dst));
}
else if (ip6) {
xmep->ipver = 6;
goto nextitem;
switch (xmep->ipver) {
case 4:
- if (UNALIGNED_MEMCMP(&ip->ip_src, &xmep->server,
- sizeof(ip->ip_src)) != 0 ||
- UNALIGNED_MEMCMP(&ip->ip_dst, &xmep->client,
- sizeof(ip->ip_dst)) != 0) {
+ if (UNALIGNED_MEMCMP(ip->ip_src, &xmep->server,
+ sizeof(ip->ip_src)) != 0 ||
+ UNALIGNED_MEMCMP(ip->ip_dst, &xmep->client,
+ sizeof(ip->ip_dst)) != 0) {
cmp = 0;
}
break;
ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
ND_PRINT("\n\t Mask %s\n\t Connected Routers:",
ipaddr_string(ndo, lsap->lsa_un.un_nla.nla_mask));
- ap = &lsap->lsa_un.un_nla.nla_router[0];
+ ap = lsap->lsa_un.un_nla.nla_router;
while ((const u_char *)ap < ls_end) {
ND_TCHECK_SIZE(ap);
ND_PRINT("\n\t %s", ipaddr_string(ndo, *ap));
rx_cache_next = 0;
rxent->callnum = EXTRACT_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));
+ UNALIGNED_MEMCPY(&rxent->client, ip->ip_src, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&rxent->server, ip->ip_dst, sizeof(uint32_t));
rxent->dport = dport;
rxent->serviceId = EXTRACT_BE_U_4(rxh->serviceId);
rxent->opcode = EXTRACT_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));
+ UNALIGNED_MEMCPY(&clip, ip->ip_dst, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&sip, ip->ip_src, sizeof(uint32_t));
/* Start the search where we last left off */
if (sport > dport)
rev = 1;
else if (sport == dport) {
- if (UNALIGNED_MEMCMP(&ip->ip_src, &ip->ip_dst, sizeof ip->ip_dst) > 0)
+ if (UNALIGNED_MEMCMP(ip->ip_src, ip->ip_dst, sizeof ip->ip_dst) > 0)
rev = 1;
}
if (rev) {
- UNALIGNED_MEMCPY(&tha.src, &ip->ip_dst, sizeof ip->ip_dst);
- UNALIGNED_MEMCPY(&tha.dst, &ip->ip_src, sizeof ip->ip_src);
+ UNALIGNED_MEMCPY(&tha.src, ip->ip_dst,
+ sizeof ip->ip_dst);
+ UNALIGNED_MEMCPY(&tha.dst, ip->ip_src,
+ sizeof ip->ip_src);
tha.port = dport << 16 | sport;
} else {
- UNALIGNED_MEMCPY(&tha.dst, &ip->ip_dst, sizeof ip->ip_dst);
- UNALIGNED_MEMCPY(&tha.src, &ip->ip_src, sizeof ip->ip_src);
+ UNALIGNED_MEMCPY(&tha.dst, ip->ip_dst,
+ sizeof ip->ip_dst);
+ UNALIGNED_MEMCPY(&tha.src, ip->ip_src,
+ sizeof ip->ip_src);
tha.port = sport << 16 | dport;
}