Bumping netgraph name sizes

Harti Brandt brandt at fokus.fraunhofer.de
Mon Nov 10 03:06:09 PST 2003


Hi all,

after some discussion among people working on netgraph (julian, archie,
ru, brooks, emax and harti) it was decided that we need to bump several
constants that define the size of names (node, hook, command string names)
in netgraph because they turn out to be too short for several applications
that need longer names. This change breaks the current netgraph ABI in the
sense, that user programs and the kernel must be in sync and that
externally maintained netgraph nodes and programs must be recompiled.
Otherwise the functioning of netgraph should be unaffected (still some
testing going on). We want to have this change in the tree before 5.2 for
exactly this reason.

If anybody has a reason why this would be a bad idea (and break something)
we would like to hear that now.

Attached is the corresponding patch.

Regards,
harti

Index: sys/netgraph/ng_message.h
===================================================================
RCS file: /export/cvs/freebsd/src/sys/netgraph/ng_message.h,v
retrieving revision 1.18
diff -u -r1.18 ng_message.h
--- sys/netgraph/ng_message.h	22 Oct 2003 07:35:05 -0000	1.18
+++ sys/netgraph/ng_message.h	10 Nov 2003 11:04:07 -0000
@@ -44,11 +44,21 @@
 #define _NETGRAPH_NG_MESSAGE_H_ 1

 /* ASCII string size limits */
-#define NG_TYPELEN	15	/* max type name len (16 with null) */
-#define NG_HOOKLEN	15	/* max hook name len (16 with null) */
-#define NG_NODELEN	15	/* max node name len (16 with null) */
-#define NG_PATHLEN	511	/* max path len     (512 with null) */
-#define NG_CMDSTRLEN	15	/* max command string (16 with null) */
+#define	NG_TYPESIZ	32	/* max type name len (including null) */
+#define	NG_HOOKSIZ	32	/* max hook name len (including null) */
+#define	NG_NODESIZ	32	/* max node name len (including null) */
+#define	NG_PATHSIZ	512	/* max path len (including null) */
+#define	NG_CMDSTRSIZ	32	/* max command string (including null) */
+
+/* #ifndef BURN_BRIDGES */
+/* don't use these - they will go away */
+#define NG_TYPELEN	(NG_TYPESIZ - 1)
+#define NG_HOOKLEN	(NG_HOOKSIZ - 1)
+#define NG_NODELEN	(NG_NODESIZ - 1)
+#define NG_PATHLEN	(NG_PATHSIZ - 1)
+#define NG_CMDSTRLEN	(NG_CMDSTRSIZ - 1)
+/* #endif */
+
 #define NG_TEXTRESPONSE 1024	/* allow this length for a text response */

 /* A netgraph message */
Index: sys/netgraph/netgraph.h
===================================================================
RCS file: /export/cvs/freebsd/src/sys/netgraph/netgraph.h,v
retrieving revision 1.35
diff -u -r1.35 netgraph.h
--- sys/netgraph/netgraph.h	22 Aug 2002 00:30:03 -0000	1.35
+++ sys/netgraph/netgraph.h	10 Nov 2003 11:04:07 -0000
@@ -62,7 +62,7 @@
  * Change it for NETGRAPH_DEBUG version so we cannot mix debug and non debug
  * modules.
  */
-#define _NG_ABI_VERSION 6
+#define _NG_ABI_VERSION 7
 #ifdef	NETGRAPH_DEBUG /*----------------------------------------------*/
 #define NG_ABI_VERSION	(_NG_ABI_VERSION + 0x10000)
 #else	/* NETGRAPH_DEBUG */ /*----------------------------------------------*/

-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-current mailing list