rtadvd: consistently use MAX_ prefix

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

rtadvd: consistently use MAX_ prefix

Florian Obser-2
OK?

diff --git config.c config.c
index 842f9af..3118e93 100644
--- config.c
+++ config.c
@@ -176,11 +176,11 @@ getconfig(char *intface)
  }
 
  MAYHAVE(val, "rltime", tmp->maxinterval * 3);
- if (val && (val < tmp->maxinterval || val > MAXROUTERLIFETIME)) {
+ if (val && (val < tmp->maxinterval || val > MAX_ROUTERLIFETIME)) {
  log_warnx("router lifetime (%ld) on %s is invalid "
     "(must be 0 or between %d and %d)",
     val, intface,
-    tmp->maxinterval, MAXROUTERLIFETIME);
+    tmp->maxinterval, MAX_ROUTERLIFETIME);
  exit(1);
  }
  /*
@@ -201,10 +201,10 @@ getconfig(char *intface)
  tmp->lifetime = val & 0xffff;
 
  MAYHAVE(val, "rtime", DEF_ADVREACHABLETIME);
- if (val < 0 || val > MAXREACHABLETIME) {
+ if (val < 0 || val > MAX_REACHABLETIME) {
  log_warnx("reachable time (%ld) on %s is invalid"
     " (must be no greater than %d)",
-    val, intface, MAXREACHABLETIME);
+    val, intface, MAX_REACHABLETIME);
  exit(1);
  }
  tmp->reachabletime = (u_int32_t)val;
diff --git rtadvd.h rtadvd.h
index fea0fd8..cbefb73 100644
--- rtadvd.h
+++ rtadvd.h
@@ -44,11 +44,11 @@
 #define DEF_ADVVALIDLIFETIME 2592000
 #define DEF_ADVPREFERREDLIFETIME 604800
 
-#define MAXROUTERLIFETIME 9000
+#define MAX_ROUTERLIFETIME 9000
 #define MIN_MAXINTERVAL 4
 #define MAX_MAXINTERVAL 1800
 #define MIN_MININTERVAL 3
-#define MAXREACHABLETIME 3600000
+#define MAX_REACHABLETIME 3600000
 
 #define MAX_INITIAL_RTR_ADVERT_INTERVAL  16
 #define MAX_INITIAL_RTR_ADVERTISEMENTS    3


--
I'm not entirely sure you are real.

Reply | Threaded
Open this post in threaded view
|

Re: rtadvd: consistently use MAX_ prefix

Jeremie Courreges-Anglas-2
Florian Obser <[hidden email]> writes:

> OK?

Looks better, but are still discrepancies (eg MAX_ROUTERLIFETIME vs.
MAX_ROUTER_LIFETIME).  I don't think we care much, though... ok jca@

$ grep -e MIN -e MAX rtadvd.h
#define DEF_MAXRTRADVINTERVAL 600
#define MAX_ROUTERLIFETIME 9000
#define MIN_MAXINTERVAL 4
#define MAX_MAXINTERVAL 1800
#define MIN_MININTERVAL 3
#define MAX_REACHABLETIME 3600000
#define MAX_INITIAL_RTR_ADVERT_INTERVAL  16
#define MAX_INITIAL_RTR_ADVERTISEMENTS    3
#define MAX_FINAL_RTR_ADVERTISEMENTS      3
#define MIN_DELAY_BETWEEN_RAS             3
#define MAX_RA_DELAY_TIME                 500000 /* usec */

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE