From 6b22e10a267768df8040092cfca76d6ecc41fbb1 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Wed, 6 Mar 2024 16:58:37 +1100 Subject: tap: make tap_update_mac() generic Use ethhdr rather than tap_hdr. Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Message-ID: <20240303135114.1023026-9-lvivier@redhat.com> Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tap.c') diff --git a/tap.c b/tap.c index f971461..c7b9372 100644 --- a/tap.c +++ b/tap.c @@ -419,18 +419,18 @@ size_t tap_send_frames(const struct ctx *c, const struct iovec *iov, size_t n) } /** - * tap_update_mac() - Update tap L2 header with new Ethernet addresses - * @taph: Tap headers to update + * eth_update_mac() - Update tap L2 header with new Ethernet addresses + * @eh: Ethernet headers to update * @eth_d: Ethernet destination address, NULL if unchanged * @eth_s: Ethernet source address, NULL if unchanged */ -void tap_update_mac(struct tap_hdr *taph, +void eth_update_mac(struct ethhdr *eh, const unsigned char *eth_d, const unsigned char *eth_s) { if (eth_d) - memcpy(taph->eh.h_dest, eth_d, sizeof(taph->eh.h_dest)); + memcpy(eh->h_dest, eth_d, sizeof(eh->h_dest)); if (eth_s) - memcpy(taph->eh.h_source, eth_s, sizeof(taph->eh.h_source)); + memcpy(eh->h_source, eth_s, sizeof(eh->h_source)); } PACKET_POOL_DECL(pool_l4, UIO_MAXIOV, pkt_buf); -- cgit v1.2.3