summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifvlan.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-02-27 00:31:34 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-02-27 00:31:34 +0000
commit2af9e81296d11b332adae2fe9855f658a4660ae8 (patch)
tree7275c4eafc8684e62de1c0c3a9947ef80862818d /sbin/ifconfig/ifvlan.c
parent9e19feba057306f5e98a28151c121d0eefe749f2 (diff)
downloadFreeBSD-src-2af9e81296d11b332adae2fe9855f658a4660ae8.zip
FreeBSD-src-2af9e81296d11b332adae2fe9855f658a4660ae8.tar.gz
Replace clone_setcallback() with a new function clone_setdefcallback()
that selects a callback from an interface prefix name. This allows us to report a meaningful error when the user types 'ifconfig wlan0 create', for example, and also kills some redundant code. Reviewed by: sam (earlier version)
Diffstat (limited to 'sbin/ifconfig/ifvlan.c')
-rw-r--r--sbin/ifconfig/ifvlan.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c
index 6742789..0f65846 100644
--- a/sbin/ifconfig/ifvlan.c
+++ b/sbin/ifconfig/ifvlan.c
@@ -136,8 +136,6 @@ DECL_CMD_FUNC(setvlantag, val, d)
if (getvlan(s, &ifr, &vreq) != -1)
vlan_set(s, &ifr);
- else
- clone_setcallback(vlan_create);
}
static
@@ -149,8 +147,6 @@ DECL_CMD_FUNC(setvlandev, val, d)
if (getvlan(s, &ifr, &vreq) != -1)
vlan_set(s, &ifr);
- else
- clone_setcallback(vlan_create);
}
static
@@ -202,5 +198,6 @@ vlan_ctor(void)
cmd_register(&vlan_cmds[i]);
af_register(&af_vlan);
callback_register(vlan_cb, NULL);
+ clone_setdefcallback("vlan", vlan_create);
#undef N
}
OpenPOWER on IntegriCloud