~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Main/linux/NetIf-linux.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-13 23:06:00 UTC
  • mfrom: (0.3.2 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091013230600-xhu2pwizq0wo63l9
Tags: 3.0.8-dfsg-1ubuntu1
* Merge from debian unstable (LP: #444812), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
* Try to remove existing dkms modules before adding the new modules
  (LP: #434503)
  - debian/virtualbox-ose-source.postinst
  - debian/virtualbox-ose-guest-source.postinst
* Don't fail if dkms modules have already been removed
  - debian/virtualbox-ose-source.prerm
  - debian/virtualbox-ose-guest-source.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    int  iTmp;
53
53
    int  iFlags;
54
54
 
55
 
    while (fgets(szBuf, sizeof(szBuf)-1, fp))
 
55
    if (fp)
56
56
    {
57
 
        int n = sscanf(szBuf, "%16s %128s %128s %X %d %d %d %128s %d %d %d\n",
58
 
                   szIfName, szAddr, szGateway, &iFlags, &iTmp, &iTmp, &iTmp,
59
 
                   szMask, &iTmp, &iTmp, &iTmp);
60
 
        if (n < 10 || !(iFlags & RTF_UP))
61
 
            continue;
62
 
 
63
 
        if (strcmp(szAddr, "00000000") == 0 && strcmp(szMask, "00000000") == 0)
 
57
        while (fgets(szBuf, sizeof(szBuf)-1, fp))
64
58
        {
65
 
            fclose(fp);
66
 
            strncpy(pszName, szIfName, 16);
67
 
            pszName[16] = 0;
68
 
            return VINF_SUCCESS;
 
59
            int n = sscanf(szBuf, "%16s %128s %128s %X %d %d %d %128s %d %d %d\n",
 
60
                           szIfName, szAddr, szGateway, &iFlags, &iTmp, &iTmp, &iTmp,
 
61
                           szMask, &iTmp, &iTmp, &iTmp);
 
62
            if (n < 10 || !(iFlags & RTF_UP))
 
63
                continue;
 
64
 
 
65
            if (strcmp(szAddr, "00000000") == 0 && strcmp(szMask, "00000000") == 0)
 
66
            {
 
67
                fclose(fp);
 
68
                strncpy(pszName, szIfName, 16);
 
69
                pszName[16] = 0;
 
70
                return VINF_SUCCESS;
 
71
            }
69
72
        }
70
73
    }
71
74
    return VERR_INTERNAL_ERROR;