Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/interface.c

    r740 r988  
    2020
    2121#include "includes.h"
    22 #include "interfaces.h"
     22#include "lib/socket/interfaces.h"
     23#include "librpc/gen_ndr/ioctl.h"
    2324
    2425static struct iface_struct *probed_ifaces;
     
    306307        struct interface *iface;
    307308
    308         if (iface_find((struct sockaddr *)&ifs->ip, False)) {
     309        if (iface_find((struct sockaddr *)&ifs->ip, False)) {
    309310                DEBUG(3,("add_interface: not adding duplicate interface %s\n",
    310311                        print_sockaddr(addr, sizeof(addr), &ifs->ip) ));
     
    334335        iface->netmask = ifs->netmask;
    335336        iface->bcast = ifs->bcast;
     337
     338
     339
    336340
    337341        DLIST_ADD(local_interfaces, iface);
     
    348352}
    349353
     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
    350393/****************************************************************************
    351394 Interpret a single element from a interfaces= config line.
     
    358401 4) ip/mask
    359402 5) bcast/mask
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
    360417****************************************************************************/
    361418
     
    371428        bool added=false;
    372429        bool goodaddr = false;
     430
     431
     432
     433
     434
     435
    373436
    374437        /* first check if it is an interface name */
     
    383446        }
    384447
    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
    386466        p = strchr_m(token,'/');
    387467        if (p == NULL) {
     
    393473
    394474                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                                }
    396487                                add_interface(&probed_ifaces[i]);
    397488                                return;
     
    463554                                        p,
    464555                                        probed_ifaces[i].name));
     556
     557
     558
     559
     560
     561
     562
     563
     564
    465565                                add_interface(&probed_ifaces[i]);
    466566                                probed_ifaces[i].netmask = saved_mask;
     
    485585        ifs.netmask = ss_mask;
    486586        ifs.bcast = ss_bcast;
     587
     588
     589
     590
     591
     592
     593
     594
     595
    487596        add_interface(&ifs);
    488597}
     
    504613
    505614        if (total_probed > 0) {
    506                 probed_ifaces = (struct iface_struct *)memdup(ifaces,
     615                probed_ifaces = (struct iface_struct *)memdup(ifaces,
    507616                                sizeof(ifaces[0])*total_probed);
    508617                if (!probed_ifaces) {
    509                         DEBUG(0,("ERROR: memdup failed\n"));
     618                        DEBUG(0,("ERROR: memdup failed\n"));
    510619                        exit(1);
    511620                }
Note: See TracChangeset for help on using the changeset viewer.