Use macros to compare IP addresses

This commit is contained in:
goldsimon 2010-02-05 10:08:49 +00:00
parent c58dfa2156
commit d51d6b2d89

View File

@ -175,8 +175,8 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb)
* again & we don't have to do any reordering if it's used.
*/
INCR(vjs_packets);
if (ip->src.addr != cs->cs_ip.src.addr
|| ip->dest.addr != cs->cs_ip.dest.addr
if (!ip_addr_cmp(&ip->src, &cs->cs_ip.src)
|| !ip_addr_cmp(&ip->dest, &cs->cs_ip.dest)
|| *(long *)th != ((long *)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]) {
/*
* Wasn't the first -- search for it.
@ -196,8 +196,8 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb)
do {
lcs = cs; cs = cs->cs_next;
INCR(vjs_searches);
if (ip->src.addr == cs->cs_ip.src.addr
&& ip->dest.addr == cs->cs_ip.dest.addr
if (ip_addr_cmp(&ip->src, &cs->cs_ip.src)
&& ip_addr_cmp(&ip->dest, &cs->cs_ip.dest)
&& *(long *)th == ((long *)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]) {
goto found;
}