All of lore.kernel.org
 help / color / mirror / Atom feed
* iproute2 mpls max labels
@ 2016-07-16 18:24 Magnus Bergroth
  2016-07-21 18:53 ` Roopa Prabhu
  0 siblings, 1 reply; 10+ messages in thread
From: Magnus Bergroth @ 2016-07-16 18:24 UTC (permalink / raw)
  To: netdev


Wanted to use more than the default maximum of 8 mpls labels. Max labels
seems to be hardcode to 8 in two places.

--- iproute2-4.6.0/lib/utils.c    2016-05-18 20:56:02.000000000 +0200
+++ iproute2-4.6.0-bergroth/lib/utils.c    2016-07-16 20:12:10.714958071
+0200
@@ -476,7 +476,7 @@
         addr->bytelen = 4;
         addr->bitlen = 20;
         /* How many bytes do I need? */
-        for (i = 0; i < 8; i++) {
+        for (i = 0; i < MPLS_MAX_LABELS; i++) {
             if (ntohl(addr->data[i]) & MPLS_LS_S_MASK) {
                 addr->bytelen = (i + 1)*4;
                 break;


--- iproute2-4.6.0/include/utils.h    2016-05-18 20:56:02.000000000 +0200
+++ iproute2-4.6.0-bergroth/include/utils.h    2016-07-15
11:55:57.297681742 +0200
@@ -54,6 +54,9 @@
 #define NEXT_ARG_FWD() do { argv++; argc--; } while(0)
 #define PREV_ARG() do { argv--; argc++; } while(0)

+/* Maximum number of labels the mpls helpers support */
+#define MPLS_MAX_LABELS 8
+
 typedef struct
 {
     __u16 flags;
@@ -61,7 +64,7 @@
     __s16 bitlen;
     /* These next two fields match rtvia */
     __u16 family;
-    __u32 data[8];
+    __u32 data[MPLS_MAX_LABELS];
 } inet_prefix;

 #define PREFIXLEN_SPECIFIED 1
@@ -88,9 +91,6 @@
 # define AF_MPLS 28
 #endif

-/* Maximum number of labels the mpls helpers support */
-#define MPLS_MAX_LABELS 8
-
 __u32 get_addr32(const char *name);
 int get_addr_1(inet_prefix *dst, const char *arg, int family);
 int get_prefix_1(inet_prefix *dst, char *arg, int family);




Kindly

Magnus Bergroth

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-23 23:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-16 18:24 iproute2 mpls max labels Magnus Bergroth
2016-07-21 18:53 ` Roopa Prabhu
2016-07-21 19:43   ` Magnus Bergroth
2016-07-23 23:04     ` Roopa Prabhu
2016-07-21 20:00   ` Eric W. Biederman
2016-07-21 21:08     ` Magnus Bergroth
2016-07-22 19:24       ` Eric W. Biederman
2016-07-22  6:16     ` Roopa Prabhu
2016-07-22 19:20       ` Eric W. Biederman
2016-07-23 23:03         ` Roopa Prabhu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.