From 6a7cff75c64651d940b5bfc4bcf83e64fbb8345f Mon Sep 17 00:00:00 2001 From: Lu Feng Date: Wed, 25 Jun 2014 07:43:15 +0000 Subject: ripd: use only one constant for derivation RIP_MAX_RTE is defined in ripd.h as 25 but is in fact the result of a formula. More over it is not used in the code: the code itself includes the fomula. This makes it un-clear for maintenance. Signed-off-by: Feng Lu Reviewed-by: Alain Ritoux Signed-off-by: David Lamparter (cherry picked from commit 342a31bfda21616209366679ac522471e5772a2f) --- ripd/ripd.c | 2 +- ripd/ripd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ripd') diff --git a/ripd/ripd.c b/ripd/ripd.c index eed1956f8..0f88a6cb0 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2167,7 +2167,7 @@ rip_output_process (struct connected *ifc, struct sockaddr_in *to, /* Reset stream and RTE counter. */ stream_reset (s); - rtemax = (RIP_PACKET_MAXSIZ - 4) / 20; + rtemax = RIP_MAX_RTE; /* Get RIP interface. */ ri = ifc->ifp->info; diff --git a/ripd/ripd.h b/ripd/ripd.h index fe1345c6f..390f832db 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -49,7 +49,7 @@ #define RIP_RTE_SIZE 20 /* Max count of routing table entry in one rip packet. */ -#define RIP_MAX_RTE 25 +#define RIP_MAX_RTE ((RIP_PACKET_MAXSIZ - RIP_HEADER_SIZE) / RIP_RTE_SIZE) /* RIP version 2 multicast address. */ #ifndef INADDR_RIP_GROUP -- cgit v1.2.3