[Olsr-dev] [PATCH v1 1/2] lq_packet: make the hello link order a define

Ferry Huberts (spam-protected)
Mon Jan 30 18:24:29 CET 2017


From: Ferry Huberts <(spam-protected)>

This will be re-used later

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/lq_packet.c     | 2 +-
 src/olsr_protocol.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lq_packet.c b/src/lq_packet.c
index 287f4b4..5364f8b 100644
--- a/src/lq_packet.c
+++ b/src/lq_packet.c
@@ -326,7 +326,7 @@ serialize_common(struct olsr_common *comm)
 static void
 serialize_lq_hello(struct lq_hello_message *lq_hello, struct interface_olsr *outif)
 {
-  static const int LINK_ORDER[] = { UNSPEC_LINK, LOST_LINK, ASYM_LINK, SYM_LINK };
+  static const int LINK_ORDER[] = HELLO_LINK_ORDER_ARRAY;
   int rem, size, req, expected_size = 0;
   struct lq_hello_info_header *info_head;
   struct lq_hello_neighbor *neigh;
diff --git a/src/olsr_protocol.h b/src/olsr_protocol.h
index a995db0..90e4db3 100644
--- a/src/olsr_protocol.h
+++ b/src/olsr_protocol.h
@@ -111,6 +111,8 @@ struct olsr;
 #define HIDE_LINK             4
 #define MAX_LINK              4
 
+#define HELLO_LINK_ORDER_ARRAY { UNSPEC_LINK, LOST_LINK, ASYM_LINK, SYM_LINK }
+
 static INLINE const char * linkTypeToString(int type) {
   switch (type) {
     case ASYM_LINK:
-- 
2.9.3




More information about the Olsr-dev mailing list