From ca115e8e21999982cc6036ff3380cfa8715454ff Mon Sep 17 00:00:00 2001 From: yar Date: Thu, 9 Mar 2006 14:58:09 +0000 Subject: 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 --- sbin/ifconfig/ifvlan.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sbin/ifconfig') 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; -- cgit v1.1