~ubuntu-core-dev/netcfg/ubuntu

« back to all changes in this revision

Viewing changes to write_interface.c

  • Committer: Dimitri John Ledkov
  • Date: 2016-04-20 11:25:23 UTC
  • Revision ID: xnox@ubuntu.com-20160420112523-gjxuz440q81syvf6
Add vlan support, based on YunQiang Su patch and Philipp Kern's
rewrite, with own additions. Closes: #433568

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        return 1;
45
45
}
46
46
 
 
47
/* Write VLAN settings, such as: vlan_raw_device eth0
 
48
*/
 
49
static int nc_wi_vlan(const struct netcfg_interface *interface, FILE *fd)
 
50
{
 
51
        int rv;
 
52
        rv = 1;
 
53
        if (interface && interface->parentif &&
 
54
            (fprintf(fd, "\tvlan_raw_device %s\n", interface->parentif) < 0)) {
 
55
                rv = 0;
 
56
        }
 
57
        return rv;
 
58
}
 
59
 
 
60
 
47
61
static int nc_wi_wireless_options(const struct netcfg_interface *interface, FILE *fd)
48
62
{
49
63
        /*
259
273
                di_debug("Writing static IPv6 stanza for %s", interface->name);
260
274
                rv = nc_wi_static_ipv6(interface, fd);
261
275
        }
262
 
        
 
276
        if (rv && interface && interface->parentif) {
 
277
                di_debug("Writing VLAN: %s", interface->name);
 
278
                rv = nc_wi_vlan(interface, fd);
 
279
        }
263
280
        if (rv && interface && is_wireless_iface(interface->name)) {
264
281
                di_debug("Writing wireless options for %s", interface->name);
265
282
                rv = nc_wi_wireless_options(interface, fd);