~serge-hallyn/ubuntu/natty/lxc/lxc-fix-3bugs

« back to all changes in this revision

Viewing changes to src/lxc/conf.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Trotter
  • Date: 2010-08-04 13:23:42 UTC
  • mfrom: (1.1.5 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100804132342-ds4lm3oaroeoxfxx
Tags: 0.7.2-1
* New upstream version
* Convert libcap dependency to versioned (closes: #571527)
* Bump up standards version to 3.9.0
* Fix too-deep /usr/lib/lxc/lxc path (closes: #587847)
* Add init script (closes: #573830)
  Thanks to Przemysław Knycz <pknycz@kolnet.eu> for the base example
* Bump up standards version (3.9.1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1025
1025
 
1026
1026
        /* default: let the system to choose one interface name */
1027
1027
        if (!netdev->name)
1028
 
                netdev->name = "eth%d";
 
1028
                netdev->name = netdev->type == LXC_NET_PHYS ?
 
1029
                        netdev->link : "eth%d";
1029
1030
 
1030
1031
        /* rename the interface name */
1031
1032
        err = lxc_device_rename(ifname, netdev->name);
1284
1285
 
1285
1286
static int instanciate_phys(struct lxc_netdev *netdev)
1286
1287
{
 
1288
        if (!netdev->link) {
 
1289
                ERROR("no link specified for the physical interface");
 
1290
                return -1;
 
1291
        }
 
1292
 
1287
1293
        netdev->ifindex = if_nametoindex(netdev->link);
1288
1294
        if (!netdev->ifindex) {
1289
1295
                ERROR("failed to retrieve the index for %s", netdev->link);
1330
1336
 
1331
1337
        lxc_list_for_each(iterator, network) {
1332
1338
                netdev = iterator->elem;
1333
 
                if (netdev->ifindex > 0)
 
1339
                if (netdev->ifindex > 0 && netdev->type != LXC_NET_PHYS)
1334
1340
                        lxc_device_delete_index(netdev->ifindex);
1335
1341
        }
1336
1342
}