FreeBSD Bugzilla – Attachment 6499 Details for
Bug 14731
The kernel has vlan support but ifconfig won't config it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.30 KB, created by
les
on 1999-11-05 23:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
les
Created:
1999-11-05 23:20:01 UTC
Size:
2.30 KB
patch
obsolete
>*** ifconfig.c Fri Nov 5 11:44:00 1999 >--- nifconfig.c Fri Nov 5 11:48:18 1999 >*************** >*** 53,58 **** >--- 53,60 ---- > > #include <net/if.h> > #include <net/if_var.h> >+ #include <net/ethernet.h> >+ #include <net/if_vlan_var.h> > #include <net/if_dl.h> > #include <net/if_types.h> > #include <net/route.h> >*************** >*** 94,103 **** >--- 96,108 ---- > > struct ifreq ifr, ridreq; > struct ifaliasreq addreq; >+ struct vlanreq vlr; > struct sockaddr_in netmask; > struct netrange at_nr; /* AppleTalk net range */ > > char name[32]; >+ char parent[32]; >+ int tag; > int flags; > int metric; > int mtu; >*************** >*** 125,130 **** >--- 130,136 ---- > c_func setifaddr, setifbroadaddr, setifdstaddr, setifnetmask; > c_func setifipdst; > c_func setifflags, setifmetric, setifmtu; >+ c_func setparent; > > > #define NEXTARG 0xffffff >*************** >*** 151,156 **** >--- 157,163 ---- > #endif > { "netmask", NEXTARG, setifnetmask }, > { "range", NEXTARG, setatrange }, >+ { "parent", NEXTARG, setparent }, > { "phase", NEXTARG, setatphase }, > { "metric", NEXTARG, setifmetric }, > { "broadcast", NEXTARG, setifbroadaddr }, >*************** >*** 670,675 **** >--- 677,708 ---- > } > > void >+ setparent(val, dummy, s, afp) >+ const char *val; >+ int dummy __unused; >+ int s; >+ const struct afswtch *afp; >+ { >+ char *cp; >+ >+ ifr.ifr_data = (caddr_t)&vlr; >+ if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) < 0) >+ warn("ioctl (SIOCGETVLAN)"); >+ >+ strncpy(parent, val, sizeof (parent)); >+ if ((cp = strchr(parent, ':')) == (char *)NULL) { >+ Perror("format"); >+ } >+ *cp++ = '\0'; >+ >+ strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); >+ strncpy(vlr.vlr_parent, parent, sizeof (vlr.vlr_parent)); >+ vlr.vlr_tag = atoi(cp); >+ if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) < 0) >+ warn("ioctl (set parent)"); >+ } >+ >+ void > setifmtu(val, dummy, s, afp) > const char *val; > int dummy __unused; >*************** >*** 738,743 **** >--- 771,785 ---- > printf(" metric %d", metric); > if (mtu) > printf(" mtu %d", mtu); >+ if (!strncmp(name, "vlan", 4)) { >+ ifr.ifr_data = (caddr_t)&vlr; >+ if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) < 0) { >+ warn("ioctl (SIOCGETVLAN)"); >+ } >+ if (strlen(vlr.vlr_parent)) >+ printf(" parent %s:%d", vlr.vlr_parent, vlr.vlr_tag); >+ >+ } > putchar('\n'); > > while (addrcount > 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14731
: 6499 |
6500