Change to support vmware... SIOCSIFADDR on the character device
sets the (notional) "remote" ethernet address. Submitted by: vsilyaev@mindspring.com
This commit is contained in:
parent
ea75f4ac9e
commit
0b4affe7c4
@ -284,6 +284,8 @@ tapopen(dev, flag, mode, p)
|
||||
if (tp->tap_flags & TAP_OPEN)
|
||||
return (EBUSY);
|
||||
|
||||
bcopy(tp->arpcom.ac_enaddr, tp->ether_addr, sizeof(tp->ether_addr));
|
||||
|
||||
tp->tap_pid = p->p_pid;
|
||||
tp->tap_flags |= TAP_OPEN;
|
||||
taprefcnt ++;
|
||||
@ -610,15 +612,13 @@ tapioctl(dev, cmd, data, flag, p)
|
||||
splx(s);
|
||||
} break;
|
||||
|
||||
case OSIOCGIFADDR: /* get MAC address */
|
||||
case OSIOCGIFADDR: /* get MAC address of the remote side */
|
||||
case SIOCGIFADDR:
|
||||
bcopy(tp->arpcom.ac_enaddr, data, ETHER_ADDR_LEN);
|
||||
bcopy(tp->ether_addr, data, sizeof(tp->ether_addr));
|
||||
break;
|
||||
|
||||
case SIOCSIFADDR: /* set MAC address */
|
||||
s = splimp();
|
||||
bcopy(data, tp->arpcom.ac_enaddr, ETHER_ADDR_LEN);
|
||||
splx(s);
|
||||
case SIOCSIFADDR: /* set MAC address of the remote side */
|
||||
bcopy(data, tp->ether_addr, sizeof(tp->ether_addr));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -54,6 +54,8 @@ struct tap_softc {
|
||||
#define TAP_READY (TAP_OPEN|TAP_INITED)
|
||||
#define TAP_VMNET (1 << 4)
|
||||
|
||||
u_int8_t ether_addr[ETHER_ADDR_LEN]; /* ether addr of the remote side */
|
||||
|
||||
pid_t tap_pid; /* PID of process to open */
|
||||
struct sigio *tap_sigio; /* information for async I/O */
|
||||
struct selinfo tap_rsel; /* read select */
|
||||
|
Loading…
Reference in New Issue
Block a user