summaryrefslogtreecommitdiff
path: root/eth-multiplexer/vdev.c
AgeCommit message (Collapse)Author
2023-06-14Replace msgh_kind with msgh_seqnoFlavio Cruz
msgh_kind is deprecated and is an alias to msgh_seqno. Message-Id: <ZIfy1sJwuhEtKSPH@jupiter.lan>
2023-05-06Update eth-multiplexer/vdev.c to be more portableFlavio Cruz
* Perform the correct alignment for x86_64. * Use designated initializers. Message-Id: <ZFSJeDp9rWoNK4lL@jupiter.tail36e24.ts.net>
2023-04-03Modernize code by removing use of old style definitions.Flavio Cruz
Also add -Werror=old-style-definition to enforce new code. Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
2022-01-17Fix const warningsSamuel Thibault
Now that the RPCs have const, this forces us cleaning our const-meant functions.
2020-11-22eth-multiplexer: Fix interface name truncationSamuel Thibault
* eth-multiplexer/vdev.c (add_vdev): Fix terminating vdev->name string.
2017-09-25eth-multiplexer: Avoid copying data multiple times.Justus Winter
* eth-multiplexer/vdev.c (broadcast_pack): Construct message just once. (deliver_pack): Remove function. (deliver_msg): Make function static. * eth-multiplexer/vdev.h (deliver_{msg,pack}): Remove declarations.
2017-09-25eth-multiplexer: Simplify device creation.Justus Winter
* eth-multiplexer/vdev.c (add_vdev): Remove class and bucket parameter. * eth-multiplexer/vdev.h (add_vdev): Likewise. * eth-multiplexer/device_impl.c (ds_device_open): Update callsite.
2017-09-25eth-multiplexer: Remove unused function.Justus Winter
* eth-multiplexer/vdev.c (has_vdev): Drop function. * eth-multiplexer/vdev.h (has_vdev): Drop declaration.
2017-08-23eth-multiplexer: Respect interfaces up flags.Justus Winter
* 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.
2016-11-05eth-multiplexer: Generate stable ethernet addresses.Justus Winter
Previously, the ethernet multiplexer generated ethernet addresses for the virtual interfaces using a pseudo-random number generator. This has the downside of generating a new address every time. Generate stable pseudo-random addresses instead. * eth-multiplexer/Makefile (HURDLIBS): Link to libihash. * eth-multiplexer/ethernet.c (ether_address): New variable. (get_ethernet_address): New function. (ethernet_open): Get the ethernet address of the real interface. * eth-multiplexer/ethernet.h (ether_address): New declaration. * eth-multiplexer/vdev.c (add_vdev): Compute the ethernet address by hashing the address of the real interface with the name of the virtual interface.
2016-11-05eth-multiplexer: Avoid local definitions.Justus Winter
* eth-multiplexer/util.h: Include 'net/if_ether.h'. (ETH_ALEN): Drop. (struct ethhdr): Likewise. * eth-multiplexer/vdev.c: Include 'net/if_ether.h'. (ETH_HLEN): Drop.
2016-11-05eth-multiplexer: Fix packet delivery.Justus Winter
* eth-multiplexer/vdev.c (deliver_msg): Do not return an error if delivering a message fails. Doing so prevents all other filters from being executed, and more importantly aborts the iteration over all virtual devices.
2016-11-04eth-multiplexer: Merge the eth-multiplexer.Zheng Da
* Makefile (prog-subdirs): Add the new program. * NEWS: Update. * eth-multiplexer/ChangeLog: New file. * eth-multiplexer/Makefile: Likewise. * eth-multiplexer/README: Likewise. * eth-multiplexer/demuxer.c: Likewise. * eth-multiplexer/dev_stat.c: Likewise. * eth-multiplexer/device_impl.c: Likewise. * eth-multiplexer/ethernet.c: Likewise. * eth-multiplexer/ethernet.h: Likewise. * eth-multiplexer/mig-decls.h: Likewise. * eth-multiplexer/mig-mutate.h: Likewise. * eth-multiplexer/multiplexer.c: Likewise. * eth-multiplexer/netfs_impl.c: Likewise. * eth-multiplexer/netfs_impl.h: Likewise. * eth-multiplexer/notify_impl.c: Likewise. * eth-multiplexer/test.c: Likewise. * eth-multiplexer/util.h: Likewise. * eth-multiplexer/vdev.c: Likewise. * eth-multiplexer/vdev.h: Likewise. The eth-multiplexer has been written by Zheng Da. This merges his work into the main repository.