Commit cdd79c66 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/tools/radiusvlan: actually call wrs_vlans command

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 6354948e
......@@ -87,6 +87,7 @@ int rvlan_fsm(struct rvlan_dev *dev, fd_set *rdset)
struct sockaddr_in from;
socklen_t fromlen = sizeof(from);
static unsigned char frame[512];
static char cmdstr[128];
int pipe0[2], pipe1[2];
/* First of all, process up/down changes */
......@@ -309,11 +310,21 @@ int rvlan_fsm(struct rvlan_dev *dev, fd_set *rdset)
break;
case RVLAN_CONFIG:
/*
* I expected to call wrsw_vlans here, but some parameters
* are global, so we must do that outside of this
* Call wrsw_vlans here. Still, port lists are
* global so request an outer action with the
* change_pending flag.
*/
rvlan_change_pending++;
sprintf(cmdstr, "wrs_vlans --port %i --pvid %i > /dev/null "
"2> /dev/null", dev->portnr, dev->chosen_vlan);
if (system(cmdstr)) {
fprintf(stderr, "%s: can't set vlan %i for %i (%s)\n",
prgname, dev->chosen_vlan, dev->portnr,
dev->name);
return -1;
}
dev->fsm_state = RVLAN_CONFIGURED;
rvlan_change_pending++;
break;
case RVLAN_CONFIGURED:
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment