@@ -4117,7 +4117,7 @@ json_parse_config(json_t *root)
41174117
41184118 const char * schema [] = {
41194119 "io-mode" , "io-slots" , "io-burst" , "qdisc-bypass" ,
4120- "tx-interval" , "rx-interval" , "tx-threads" ,
4120+ "tx-interval" , "rx-interval" , "tx-threads" , "tun-name" ,
41214121 "rx-threads" , "capture-include-streams" , "mac-modifier" ,
41224122 "lag" , "network" , "access" , "a10nsp" , "links" , "a10nsp-dynamic"
41234123 };
@@ -4190,6 +4190,13 @@ json_parse_config(json_t *root)
41904190 if (value ) {
41914191 g_ctx -> config .a10nsp_dynamic = json_boolean_value (value );
41924192 }
4193+ if (json_unpack (section , "{s:s}" , "tun-name" , & s ) == 0 ) {
4194+ if (strlen (s ) > 10 ) {
4195+ fprintf (stderr , "JSON config error: Invalid value for interfaces->tun-name (string length > 10)\n" );
4196+ return false;
4197+ }
4198+ g_ctx -> config .tun_name = strdup (s );
4199+ }
41934200 /* LAG Configuration Section */
41944201 sub = json_object_get (section , "lag" );
41954202 if (json_is_array (sub )) {
@@ -4668,6 +4675,7 @@ bbl_config_init_defaults()
46684675 g_ctx -> config .io_burst = 256 ;
46694676 g_ctx -> config .io_max_stream_len = 9000 ;
46704677 g_ctx -> config .qdisc_bypass = true;
4678+ g_ctx -> config .tun_name = "bbl" ;
46714679 g_ctx -> config .sessions = 1 ;
46724680 g_ctx -> config .sessions_max_outstanding = 800 ;
46734681 g_ctx -> config .sessions_start_period_ns = 2500000 ; /* 400/s */
0 commit comments