@@ -196,13 +196,13 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
196
196
return 0 ;
197
197
}
198
198
199
- cfg -> portid_list = malloc (sizeof (uint16_t )* MAX_ETHPORTS );
199
+ cfg -> portid_list = malloc (sizeof (uint16_t )* MAX_ETHPORTS );
200
200
if (cfg -> portid_list == NULL ) {
201
201
fprintf (stderr , "parse_port_list malloc failed\n" );
202
202
return 0 ;
203
203
}
204
- memset (cfg -> portid_list ,0 ,sizeof (uint16_t )* MAX_ETHPORTS );
205
-
204
+ memset (cfg -> portid_list ,0 ,sizeof (uint16_t )* MAX_ETHPORTS );
205
+
206
206
cfg -> max_portid = cfg -> portid_list [MAX_ETHPORTS - 1 ];
207
207
// initialize lcore list and nb_lcores
208
208
int i ;
@@ -215,7 +215,6 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
215
215
}
216
216
cfg -> port_cfgs = pc ;
217
217
218
-
219
218
}
220
219
221
220
int portid ;
@@ -238,15 +237,18 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
238
237
}
239
238
240
239
if (strcmp (name , "addr" ) == 0 ) {
240
+ printf ("em0: ipaddr:%s\n" ,value );
241
241
cur -> addr = strdup (value );
242
242
} else if (strcmp (name , "netmask" ) == 0 ) {
243
+ printf ("em0: netmask:%s\n" ,value );
243
244
cur -> netmask = strdup (value );
244
245
} else if (strcmp (name , "broadcast" ) == 0 ) {
245
246
cur -> broadcast = strdup (value );
246
247
} else if (strcmp (name , "gateway" ) == 0 ) {
248
+ printf ("em0: gateway:%s\n" ,value );
247
249
cur -> gateway = strdup (value );
248
- } else if (strcmp (name , "mac" ) == 0 ) {
249
- set_port_mac (cur -> mac ,value );
250
+ } else if (strcmp (name , "mac" ) == 0 ) {
251
+ set_port_mac (cur -> mac ,value );
250
252
}
251
253
252
254
return 1 ;
0 commit comments