mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 18:14:29 +08:00
Remove unneeded '&' when getting a pointer to a nd_ipv4 type
This commit is contained in:
parent
90528d4c39
commit
5922b80797
@ -780,8 +780,10 @@ cookie_record(const cookie_t *in, const u_char *bp2)
|
|||||||
switch (IP_V(ip)) {
|
switch (IP_V(ip)) {
|
||||||
case 4:
|
case 4:
|
||||||
cookiecache[ninitiator].version = 4;
|
cookiecache[ninitiator].version = 4;
|
||||||
UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4, &ip->ip_src, sizeof(nd_ipv4));
|
UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4,
|
||||||
UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4, &ip->ip_dst, sizeof(nd_ipv4));
|
ip->ip_src, sizeof(nd_ipv4));
|
||||||
|
UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4,
|
||||||
|
ip->ip_dst, sizeof(nd_ipv4));
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
ip6 = (const struct ip6_hdr *)bp2;
|
ip6 = (const struct ip6_hdr *)bp2;
|
||||||
@ -810,10 +812,10 @@ cookie_sidecheck(int i, const u_char *bp2, int initiator)
|
|||||||
if (cookiecache[i].version != 4)
|
if (cookiecache[i].version != 4)
|
||||||
return 0;
|
return 0;
|
||||||
if (initiator) {
|
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;
|
return 1;
|
||||||
} else {
|
} 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;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
14
print-nfs.c
14
print-nfs.c
@ -920,8 +920,10 @@ xid_map_enter(netdissect_options *ndo,
|
|||||||
UNALIGNED_MEMCPY(&xmep->xid, &rp->rm_xid, sizeof(xmep->xid));
|
UNALIGNED_MEMCPY(&xmep->xid, &rp->rm_xid, sizeof(xmep->xid));
|
||||||
if (ip) {
|
if (ip) {
|
||||||
xmep->ipver = 4;
|
xmep->ipver = 4;
|
||||||
UNALIGNED_MEMCPY(&xmep->client, &ip->ip_src, sizeof(ip->ip_src));
|
UNALIGNED_MEMCPY(&xmep->client, ip->ip_src,
|
||||||
UNALIGNED_MEMCPY(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst));
|
sizeof(ip->ip_src));
|
||||||
|
UNALIGNED_MEMCPY(&xmep->server, ip->ip_dst,
|
||||||
|
sizeof(ip->ip_dst));
|
||||||
}
|
}
|
||||||
else if (ip6) {
|
else if (ip6) {
|
||||||
xmep->ipver = 6;
|
xmep->ipver = 6;
|
||||||
@ -958,10 +960,10 @@ xid_map_find(const struct sunrpc_msg *rp, const u_char *bp, uint32_t *proc,
|
|||||||
goto nextitem;
|
goto nextitem;
|
||||||
switch (xmep->ipver) {
|
switch (xmep->ipver) {
|
||||||
case 4:
|
case 4:
|
||||||
if (UNALIGNED_MEMCMP(&ip->ip_src, &xmep->server,
|
if (UNALIGNED_MEMCMP(ip->ip_src, &xmep->server,
|
||||||
sizeof(ip->ip_src)) != 0 ||
|
sizeof(ip->ip_src)) != 0 ||
|
||||||
UNALIGNED_MEMCMP(&ip->ip_dst, &xmep->client,
|
UNALIGNED_MEMCMP(ip->ip_dst, &xmep->client,
|
||||||
sizeof(ip->ip_dst)) != 0) {
|
sizeof(ip->ip_dst)) != 0) {
|
||||||
cmp = 0;
|
cmp = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -692,7 +692,7 @@ ospf_print_lsa(netdissect_options *ndo,
|
|||||||
ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
|
ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
|
||||||
ND_PRINT("\n\t Mask %s\n\t Connected Routers:",
|
ND_PRINT("\n\t Mask %s\n\t Connected Routers:",
|
||||||
ipaddr_string(ndo, lsap->lsa_un.un_nla.nla_mask));
|
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) {
|
while ((const u_char *)ap < ls_end) {
|
||||||
ND_TCHECK_SIZE(ap);
|
ND_TCHECK_SIZE(ap);
|
||||||
ND_PRINT("\n\t %s", ipaddr_string(ndo, *ap));
|
ND_PRINT("\n\t %s", ipaddr_string(ndo, *ap));
|
||||||
|
@ -697,8 +697,8 @@ rx_cache_insert(netdissect_options *ndo,
|
|||||||
rx_cache_next = 0;
|
rx_cache_next = 0;
|
||||||
|
|
||||||
rxent->callnum = EXTRACT_BE_U_4(rxh->callNumber);
|
rxent->callnum = EXTRACT_BE_U_4(rxh->callNumber);
|
||||||
UNALIGNED_MEMCPY(&rxent->client, &ip->ip_src, sizeof(uint32_t));
|
UNALIGNED_MEMCPY(&rxent->client, ip->ip_src, sizeof(uint32_t));
|
||||||
UNALIGNED_MEMCPY(&rxent->server, &ip->ip_dst, sizeof(uint32_t));
|
UNALIGNED_MEMCPY(&rxent->server, ip->ip_dst, sizeof(uint32_t));
|
||||||
rxent->dport = dport;
|
rxent->dport = dport;
|
||||||
rxent->serviceId = EXTRACT_BE_U_4(rxh->serviceId);
|
rxent->serviceId = EXTRACT_BE_U_4(rxh->serviceId);
|
||||||
rxent->opcode = EXTRACT_BE_U_4(bp + sizeof(struct rx_header));
|
rxent->opcode = EXTRACT_BE_U_4(bp + sizeof(struct rx_header));
|
||||||
@ -720,8 +720,8 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
|
|||||||
uint32_t clip;
|
uint32_t clip;
|
||||||
uint32_t sip;
|
uint32_t sip;
|
||||||
|
|
||||||
UNALIGNED_MEMCPY(&clip, &ip->ip_dst, sizeof(uint32_t));
|
UNALIGNED_MEMCPY(&clip, ip->ip_dst, sizeof(uint32_t));
|
||||||
UNALIGNED_MEMCPY(&sip, &ip->ip_src, sizeof(uint32_t));
|
UNALIGNED_MEMCPY(&sip, ip->ip_src, sizeof(uint32_t));
|
||||||
|
|
||||||
/* Start the search where we last left off */
|
/* Start the search where we last left off */
|
||||||
|
|
||||||
|
14
print-tcp.c
14
print-tcp.c
@ -318,16 +318,20 @@ tcp_print(netdissect_options *ndo,
|
|||||||
if (sport > dport)
|
if (sport > dport)
|
||||||
rev = 1;
|
rev = 1;
|
||||||
else if (sport == dport) {
|
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;
|
rev = 1;
|
||||||
}
|
}
|
||||||
if (rev) {
|
if (rev) {
|
||||||
UNALIGNED_MEMCPY(&tha.src, &ip->ip_dst, sizeof ip->ip_dst);
|
UNALIGNED_MEMCPY(&tha.src, ip->ip_dst,
|
||||||
UNALIGNED_MEMCPY(&tha.dst, &ip->ip_src, sizeof ip->ip_src);
|
sizeof ip->ip_dst);
|
||||||
|
UNALIGNED_MEMCPY(&tha.dst, ip->ip_src,
|
||||||
|
sizeof ip->ip_src);
|
||||||
tha.port = dport << 16 | sport;
|
tha.port = dport << 16 | sport;
|
||||||
} else {
|
} else {
|
||||||
UNALIGNED_MEMCPY(&tha.dst, &ip->ip_dst, sizeof ip->ip_dst);
|
UNALIGNED_MEMCPY(&tha.dst, ip->ip_dst,
|
||||||
UNALIGNED_MEMCPY(&tha.src, &ip->ip_src, sizeof ip->ip_src);
|
sizeof ip->ip_dst);
|
||||||
|
UNALIGNED_MEMCPY(&tha.src, ip->ip_src,
|
||||||
|
sizeof ip->ip_src);
|
||||||
tha.port = sport << 16 | dport;
|
tha.port = sport << 16 | dport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user