diff options
author | Justus Winter <justus@gnupg.org> | 2017-08-22 19:38:25 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-23 19:01:14 +0200 |
commit | 61d5aee1ce02888e78eab4ed85a9c8e631006d7b (patch) | |
tree | a0a7368c0bba2e3c5543e438c95e2657f4f2c5ec /eth-multiplexer/device_impl.c | |
parent | ae61f83839ea072533fca15dc75284799e5e0445 (diff) | |
download | hurd-61d5aee1ce02888e78eab4ed85a9c8e631006d7b.tar.gz hurd-61d5aee1ce02888e78eab4ed85a9c8e631006d7b.tar.bz2 hurd-61d5aee1ce02888e78eab4ed85a9c8e631006d7b.zip |
eth-multiplexer: Respect interfaces up flags.
* eth-multiplexer/device_impl.c (ds_device_write): Deny writes when
interface is down.
* eth-multiplexer/vdev.c (add_vdev): Initialize flags to
a sane value.
(broadcast_pack): Skip interfaces that are down.
(broadcast_msg): Likewise.
Diffstat (limited to 'eth-multiplexer/device_impl.c')
-rw-r--r-- | eth-multiplexer/device_impl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c index 18ebf07e..f23738a1 100644 --- a/eth-multiplexer/device_impl.c +++ b/eth-multiplexer/device_impl.c @@ -108,6 +108,9 @@ ds_device_write (struct vether_device *vdev, mach_port_t reply_port, if (vdev == NULL) return D_NO_SUCH_DEVICE; + if ((vdev->if_flags & IFF_UP) == 0) + return D_DEVICE_DOWN; + /* The packet is forwarded to all virtual interfaces and * the interface which the multiplexer connects to. */ broadcast_pack (data, datalen, vdev); |