From 0b4affe7c45fa9ae067f6a6705b1071037a8f971 Mon Sep 17 00:00:00 2001 From: nsayer Date: Tue, 25 Jul 2000 23:50:30 +0000 Subject: [PATCH] Change to support vmware... SIOCSIFADDR on the character device sets the (notional) "remote" ethernet address. Submitted by: vsilyaev@mindspring.com --- sys/net/if_tap.c | 12 ++++++------ sys/net/if_tapvar.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 66af5340d663..aad9101b8b29 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -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: diff --git a/sys/net/if_tapvar.h b/sys/net/if_tapvar.h index a5e2032e0044..f57829462bb5 100644 --- a/sys/net/if_tapvar.h +++ b/sys/net/if_tapvar.h @@ -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 */