diff options
author | yar <yar@FreeBSD.org> | 2006-03-09 14:58:09 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-03-09 14:58:09 +0000 |
commit | ca115e8e21999982cc6036ff3380cfa8715454ff (patch) | |
tree | 73c30c9904aacd65be52390679ebbdffe7321ea4 /sbin | |
parent | 057f1af5e2367005b8d1ec5d034caaac920a9c2a (diff) | |
download | FreeBSD-src-ca115e8e21999982cc6036ff3380cfa8715454ff.zip FreeBSD-src-ca115e8e21999982cc6036ff3380cfa8715454ff.tar.gz |
Revert to setting vlan and vlandev parametes synchronously, as soon
as both have been read from the command line. Still use the callback,
but this time only to verify that both vlan and vlandev have been
found on the command line.
This should allow for control over the relative order of processing
parameters, which is needed to satisfy some caveats of the if_vlan
driver. E.g., MTU cannot be changed on a vlan interface until it's
attached to its parent.
PR: bin/94028
Reviewed by: ru
MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifvlan.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c index 8ec39e2..f2dfba4 100644 --- a/sbin/ifconfig/ifvlan.c +++ b/sbin/ifconfig/ifvlan.c @@ -62,6 +62,8 @@ static struct vlanreq __vreq; static int __have_dev = 0; static int __have_tag = 0; +static void vlan_set(int); + static void vlan_status(int s) { @@ -93,6 +95,7 @@ setvlantag(const char *val, int d, int s, const struct afswtch *afp) errx(1, "value for vlan out of range"); /* the kernel will do more specific checks on vlr_tag */ __have_tag = 1; + vlan_set(s); /* try setting vlan params in kernel */ } static void @@ -101,6 +104,7 @@ setvlandev(const char *val, int d, int s, const struct afswtch *afp) strncpy(__vreq.vlr_parent, val, sizeof(__vreq.vlr_parent)); __have_dev = 1; + vlan_set(s); /* try setting vlan params in kernel */ } static void @@ -130,6 +134,11 @@ vlan_cb(int s, void *arg) if (__have_tag ^ __have_dev) errx(1, "both vlan and vlandev must be specified"); +} + +static void +vlan_set(int s) +{ if (__have_tag && __have_dev) { ifr.ifr_data = (caddr_t)&__vreq; |