diff options
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_tap.c | 12 | ||||
-rw-r--r-- | 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 66af534..aad9101 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 a5e2032..f578294 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 */ |