summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-10-12 07:46:08 +0000
committerMartin Mares <mj@ucw.cz>1999-10-12 07:46:08 +0000
commit89dc383a8ce26bfe49250e5063bcadec22ff42c6 (patch)
tree3018b3f2fa90ec04e27a13f240c76ad618e62f50
parentd3dd620b96c5960207b9321b416423b8130a4df7 (diff)
Changed syntax of ip_class_mask, the old one was stupid.
-rw-r--r--lib/ipv4.h2
-rw-r--r--proto/rip/rip.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/ipv4.h b/lib/ipv4.h
index 5cb2835e..033116bb 100644
--- a/lib/ipv4.h
+++ b/lib/ipv4.h
@@ -53,7 +53,7 @@ typedef u32 ip_addr;
#define ipa_ntoh(x) x = _MI(ntohl(_I(x)))
#define ipa_classify(x) ipv4_classify(_I(x))
#define ipa_opposite(x) _MI(_I(x) ^ 1)
-#define ipa_class_mask(x) x = _MI(ipv4_class_mask(_I(x)))
+#define ipa_class_mask(x) _MI(ipv4_class_mask(_I(x)))
#define ipa_from_u32(x) _MI(x)
#define ipa_to_u32(x) _I(x)
#define ipa_compare(x,y) ipv4_compare(_I(x),_I(y))
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 78eaa657..db84e87e 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -318,10 +318,8 @@ rip_process_packet( struct proto *p, struct rip_packet *packet, int num, ip_addr
#ifndef IPV6
ipa_ntoh( block->netmask );
ipa_ntoh( block->nexthop );
- if (packet->heading.version == RIP_V1) {
- block->netmask = block->network; /* MJ: why are macros like this?! */
- ipa_class_mask( block->netmask );
- }
+ if (packet->heading.version == RIP_V1)
+ block->netmask = ipa_class_mask(block->network);
#endif
process_block( p, block, whotoldme );
}