Changeset 988 for vendor/current/source3/lib/interface.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
-
vendor/current/source3/lib/interface.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/interface.c
r740 r988 20 20 21 21 #include "includes.h" 22 #include "interfaces.h" 22 #include "lib/socket/interfaces.h" 23 #include "librpc/gen_ndr/ioctl.h" 23 24 24 25 static struct iface_struct *probed_ifaces; … … 306 307 struct interface *iface; 307 308 308 if (iface_find(( struct sockaddr *)&ifs->ip, False)) {309 if (iface_find((struct sockaddr *)&ifs->ip, False)) { 309 310 DEBUG(3,("add_interface: not adding duplicate interface %s\n", 310 311 print_sockaddr(addr, sizeof(addr), &ifs->ip) )); … … 334 335 iface->netmask = ifs->netmask; 335 336 iface->bcast = ifs->bcast; 337 338 339 336 340 337 341 DLIST_ADD(local_interfaces, iface); … … 348 352 } 349 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 350 393 /**************************************************************************** 351 394 Interpret a single element from a interfaces= config line. … … 358 401 4) ip/mask 359 402 5) bcast/mask 403 404 405 406 407 408 409 410 411 412 413 414 415 416 360 417 ****************************************************************************/ 361 418 … … 371 428 bool added=false; 372 429 bool goodaddr = false; 430 431 432 433 434 435 373 436 374 437 /* first check if it is an interface name */ … … 383 446 } 384 447 385 /* maybe it is a DNS name */ 448 /* 449 * extract speed / capability information if present 450 */ 451 p = strchr_m(token, ';'); 452 if (p != NULL) { 453 *p++ = 0; 454 parse_extra_info(p, &speed, &cap, &if_index); 455 if (speed != 0) { 456 speed_set = true; 457 } 458 if (cap != FSCTL_NET_IFACE_NONE_CAPABLE) { 459 cap_set = true; 460 } 461 if (if_index != 0) { 462 if_index_set = true; 463 } 464 } 465 386 466 p = strchr_m(token,'/'); 387 467 if (p == NULL) { … … 393 473 394 474 for (i=0;i<total_probed;i++) { 395 if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) { 475 if (sockaddr_equal((struct sockaddr *)&ss, 476 (struct sockaddr *)&probed_ifaces[i].ip)) 477 { 478 if (speed_set) { 479 probed_ifaces[i].linkspeed = speed; 480 } 481 if (cap_set) { 482 probed_ifaces[i].capability = cap; 483 } 484 if (if_index_set) { 485 probed_ifaces[i].if_index = if_index; 486 } 396 487 add_interface(&probed_ifaces[i]); 397 488 return; … … 463 554 p, 464 555 probed_ifaces[i].name)); 556 557 558 559 560 561 562 563 564 465 565 add_interface(&probed_ifaces[i]); 466 566 probed_ifaces[i].netmask = saved_mask; … … 485 585 ifs.netmask = ss_mask; 486 586 ifs.bcast = ss_bcast; 587 588 589 590 591 592 593 594 595 487 596 add_interface(&ifs); 488 597 } … … 504 613 505 614 if (total_probed > 0) { 506 probed_ifaces = (struct iface_struct *) memdup(ifaces,615 probed_ifaces = (struct iface_struct *)memdup(ifaces, 507 616 sizeof(ifaces[0])*total_probed); 508 617 if (!probed_ifaces) { 509 DEBUG(0,("ERROR: memdup failed\n"));618 DEBUG(0,("ERROR: memdup failed\n")); 510 619 exit(1); 511 620 }
Note:
See TracChangeset
for help on using the changeset viewer.
