summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/network.c18
-rw-r--r--lib/network.h18
2 files changed, 17 insertions, 19 deletions
diff --git a/lib/network.c b/lib/network.c
index d2482bd55e..411661a5e1 100644
--- a/lib/network.c
+++ b/lib/network.c
@@ -121,21 +121,3 @@ float ntohf(float net)
{
return htonf(net);
}
-
-/**
- * Helper function that returns a random long value. The main purpose of
- * this function is to hide a `random()` call that gets flagged by coverity
- * scan and put it into one place.
- *
- * The main usage of this function should be for generating jitter or weak
- * random values for simple purposes.
- *
- * See 'man 3 random' for more information.
- *
- * \returns random long integer.
- */
-long frr_weak_random(void)
-{
- /* coverity[dont_call] */
- return random();
-}
diff --git a/lib/network.h b/lib/network.h
index 83c9e59e76..4a9666984f 100644
--- a/lib/network.h
+++ b/lib/network.h
@@ -45,7 +45,23 @@ extern int set_cloexec(int fd);
extern float htonf(float);
extern float ntohf(float);
-extern long frr_weak_random(void);
+/**
+ * Helper function that returns a random long value. The main purpose of
+ * this function is to hide a `random()` call that gets flagged by coverity
+ * scan and put it into one place.
+ *
+ * The main usage of this function should be for generating jitter or weak
+ * random values for simple purposes.
+ *
+ * See 'man 3 random' for more information.
+ *
+ * \returns random long integer.
+ */
+static inline long frr_weak_random(void)
+{
+ /* coverity[dont_call] */
+ return random();
+}
#ifdef __cplusplus
}