Changes in uspace/app/inet/inet.c [3495654:b8b1adb1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/inet/inet.c
r3495654 rb8b1adb1 44 44 #include <sys/types.h> 45 45 46 #define NAME "inet"46 #define NAME "inet" 47 47 48 48 static void print_syntax(void) … … 257 257 if (count > 0) 258 258 printf(" [Addr/Width] [Link-Name] [Addr-Name] [Def-MTU]\n"); 259 ainfo.name = linfo.name = astr = NULL; 259 ainfo.name = NULL; 260 linfo.name = NULL; 261 astr = NULL; 260 262 261 263 for (i = 0; i < count; i++) { … … 290 292 free(astr); 291 293 292 ainfo.name = linfo.name = astr = NULL; 294 ainfo.name = NULL; 295 linfo.name = NULL; 296 astr = NULL; 293 297 } 294 298 … … 308 312 } 309 313 314 static int link_list(void) 315 { 316 sysarg_t *link_list; 317 inet_link_info_t linfo; 318 319 size_t count; 320 size_t i; 321 int rc; 322 323 rc = inetcfg_get_link_list(&link_list, &count); 324 if (rc != EOK) { 325 printf(NAME ": Failed getting link list.\n"); 326 return rc; 327 } 328 329 printf("IP links:\n"); 330 if (count > 0) 331 printf(" [Link-layer Address] [Link-Name] [Def-MTU]\n"); 332 333 for (i = 0; i < count; i++) { 334 rc = inetcfg_link_get(link_list[i], &linfo); 335 if (rc != EOK) { 336 printf("Failed getting properties of link %zu.\n", 337 (size_t)link_list[i]); 338 continue; 339 } 340 341 printf(" %02x:%02x:%02x:%02x:%02x:%02x %s %zu\n", 342 linfo.mac_addr[0], linfo.mac_addr[1], 343 linfo.mac_addr[2], linfo.mac_addr[3], 344 linfo.mac_addr[4], linfo.mac_addr[5], 345 linfo.name, linfo.def_mtu); 346 347 free(linfo.name); 348 349 linfo.name = NULL; 350 } 351 352 if (count == 0) 353 printf(" None\n"); 354 355 free(link_list); 356 357 return EOK; 358 } 359 310 360 static int sroute_list(void) 311 361 { … … 329 379 printf(" [Dest/Width] [Router-Addr] [Route-Name]\n"); 330 380 331 srinfo.name = dest_str = router_str = NULL; 381 srinfo.name = NULL; 382 dest_str = NULL; 383 router_str = NULL; 332 384 333 385 for (i = 0; i < count; i++) { … … 360 412 free(router_str); 361 413 362 router_str = srinfo.name = dest_str = NULL; 414 router_str = NULL; 415 srinfo.name = NULL; 416 dest_str = NULL; 363 417 } 364 418 … … 396 450 if (rc != EOK) 397 451 return 1; 452 rc = link_list(); 453 if (rc != EOK) 454 return 1; 398 455 return 0; 399 456 }
Note:
See TracChangeset
for help on using the changeset viewer.