Skip to content

Commit bd0cbcb

Browse files
riptlripatel-fd
authored andcommitted
Clean up net_hdrs
- Fix alignment of ip4_hdr and udp_hdr - Rename net_hdrs to ip4_udp_hdrs - Use strongly typed syntax for ip4_udp_hdrs to avoid pointer bugs - Disable UDP checksums
1 parent b1afbdf commit bd0cbcb

File tree

11 files changed

+159
-157
lines changed

11 files changed

+159
-157
lines changed

src/disco/net/xdp/fd_xdp_tile.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "../../../waltz/xdp/fd_xsk.h"
1919
#include "../../../util/log/fd_dtrace.h"
2020
#include "../../../util/net/fd_eth.h"
21+
#include "../../../util/net/fd_ip4.h"
2122

2223
#include <unistd.h>
2324
#include <linux/if.h> /* struct ifreq */
@@ -627,17 +628,22 @@ after_frag( fd_net_ctx_t * ctx,
627628
memcpy( frame, ctx->tx_op.mac_addrs, 12 );
628629

629630
/* Select IPv4 source address */
631+
uint ihl = frame[ 14 ] & 0x0f;
630632
ushort ethertype = FD_LOAD( ushort, frame+12 );
631633
uint ip4_saddr = FD_LOAD( uint, frame+26 );
632634
if( ethertype==fd_ushort_bswap( FD_ETH_HDR_TYPE_IP ) && ip4_saddr==0 ) {
633-
/* Outgoing IPv4 packet with unknown src IP, use prefsrc from route */
634-
if( FD_UNLIKELY( ctx->tx_op.src_ip==0 ) ) {
635-
/* Can't determine source address */
635+
if( FD_UNLIKELY( ctx->tx_op.src_ip==0 ||
636+
ihl<5 || (14+(ihl<<2))>sz ) ) {
637+
/* Outgoing IPv4 packet with unknown src IP or invalid IHL */
636638
/* FIXME should select first IPv4 address of device table here */
637639
ctx->metrics.tx_route_fail_cnt++;
638640
return;
639641
}
640-
FD_STORE( uint, frame+26, ctx->tx_op.src_ip );
642+
643+
/* Recompute checksum after changing header */
644+
FD_STORE( uint, frame+26, ctx->tx_op.src_ip );
645+
FD_STORE( ushort, frame+24, 0 );
646+
FD_STORE( ushort, frame+24, fd_ip4_hdr_check( frame+14 ) );
641647
}
642648

643649
/* Submit packet TX job

src/disco/shred/fd_shred_tile.c

+17-21
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ typedef struct {
145145

146146
int skip_frag;
147147

148-
fd_net_hdrs_t data_shred_net_hdr [1];
149-
fd_net_hdrs_t parity_shred_net_hdr[1];
148+
fd_ip4_udp_hdrs_t data_shred_net_hdr [1];
149+
fd_ip4_udp_hdrs_t parity_shred_net_hdr[1];
150150

151151
fd_wksp_t * shred_store_wksp;
152152

@@ -499,28 +499,24 @@ send_shred( fd_shred_ctx_t * ctx,
499499
uchar * packet = fd_chunk_to_laddr( ctx->net_out_mem, ctx->net_out_chunk );
500500

501501
int is_data = fd_shred_type( shred->variant )==FD_SHRED_TYPE_MERKLE_DATA;
502-
fd_net_hdrs_t * tmpl = fd_ptr_if( is_data, (fd_net_hdrs_t *)ctx->data_shred_net_hdr,
503-
(fd_net_hdrs_t *)ctx->parity_shred_net_hdr );
504-
fd_memcpy( packet, tmpl, sizeof(fd_net_hdrs_t) );
502+
fd_ip4_udp_hdrs_t * hdr = (fd_ip4_udp_hdrs_t *)packet;
503+
*hdr = *( is_data ? ctx->data_shred_net_hdr : ctx->parity_shred_net_hdr );
505504

506-
fd_net_hdrs_t * hdr = (fd_net_hdrs_t *)packet;
505+
fd_ip4_hdr_t * ip4 = hdr->ip4;
506+
ip4->daddr = dest->ip4;
507+
ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
508+
ip4->check = 0U;
509+
ip4->check = fd_ip4_hdr_check_fast( ip4 );
507510

508-
hdr->ip4->daddr = dest->ip4;
509-
hdr->ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
510-
hdr->ip4->check = 0U;
511-
hdr->ip4->check = fd_ip4_hdr_check_fast( packet+14 );
512-
513-
hdr->udp->net_dport = fd_ushort_bswap( dest->port );
511+
hdr->udp->net_dport = fd_ushort_bswap( dest->port );
514512

515513
ulong shred_sz = fd_ulong_if( is_data, FD_SHRED_MIN_SZ, FD_SHRED_MAX_SZ );
516-
fd_memcpy( packet+sizeof(fd_net_hdrs_t), shred, shred_sz );
517-
518-
ulong pkt_sz = shred_sz + sizeof(fd_net_hdrs_t);
514+
fd_memcpy( packet+sizeof(fd_ip4_udp_hdrs_t), shred, shred_sz );
519515

520-
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
521-
ulong sig = fd_disco_netmux_sig( dest->ip4, dest->port, dest->ip4, DST_PROTO_OUTGOING, FD_NETMUX_SIG_MIN_HDR_SZ );
522-
fd_mcache_publish( ctx->net_out_mcache, ctx->net_out_depth, ctx->net_out_seq, sig, ctx->net_out_chunk,
523-
pkt_sz, 0UL, tsorig, tspub );
516+
ulong pkt_sz = shred_sz + sizeof(fd_ip4_udp_hdrs_t);
517+
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
518+
ulong sig = fd_disco_netmux_sig( dest->ip4, dest->port, dest->ip4, DST_PROTO_OUTGOING, sizeof(fd_ip4_udp_hdrs_t) );
519+
fd_mcache_publish( ctx->net_out_mcache, ctx->net_out_depth, ctx->net_out_seq, sig, ctx->net_out_chunk, pkt_sz, 0UL, tsorig, tspub );
524520
ctx->net_out_seq = fd_seq_inc( ctx->net_out_seq, 1UL );
525521
ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, pkt_sz, ctx->net_out_chunk0, ctx->net_out_wmark );
526522
}
@@ -835,8 +831,8 @@ unprivileged_init( fd_topo_t * topo,
835831

836832
ctx->net_id = (ushort)0;
837833

838-
fd_net_create_packet_header_template( ctx->data_shred_net_hdr, FD_SHRED_MIN_SZ, 0, tile->shred.shred_listen_port );
839-
fd_net_create_packet_header_template( ctx->parity_shred_net_hdr, FD_SHRED_MAX_SZ, 0, tile->shred.shred_listen_port );
834+
fd_ip4_udp_hdr_init( ctx->data_shred_net_hdr, FD_SHRED_MIN_SZ, 0, tile->shred.shred_listen_port );
835+
fd_ip4_udp_hdr_init( ctx->parity_shred_net_hdr, FD_SHRED_MAX_SZ, 0, tile->shred.shred_listen_port );
840836

841837
for( ulong i=0UL; i<tile->in_cnt; i++ ) {
842838
fd_topo_link_t const * link = &topo->links[ tile->in_link_id[ i ] ];

src/discof/eqvoc/fd_eqvoc_tile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ during_frag( fd_eqvoc_tile_ctx_t * ctx,
152152

153153
uchar * packet = fd_chunk_to_laddr( ctx->shred_net_in_mem, chunk );
154154
// memcpy( packet + sizeof(fd_net_hdrs_t), packet, sizeof(fd_shred_t) );
155-
fd_shred_t * shred = (fd_shred_t *)(packet + sizeof(fd_net_hdrs_t));
155+
fd_shred_t * shred = (fd_shred_t *)( packet + fd_disco_netmux_sig_hdr_sz( sig ) );
156156
memcpy( &ctx->shred, shred, sizeof(fd_shred_t) );
157157
}
158158
}

src/discof/gossip/fd_gossip_tile.c

+21-24
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct fd_gossip_tile_ctx {
200200
uchar gossip_buffer[ FD_NET_MTU ];
201201

202202
ushort net_id;
203-
fd_net_hdrs_t hdr[1];
203+
fd_ip4_udp_hdrs_t hdr[1];
204204

205205
fd_keyguard_client_t keyguard_client[1];
206206

@@ -250,28 +250,25 @@ send_packet( fd_gossip_tile_ctx_t * ctx,
250250
ulong tsorig ) {
251251
uchar * packet = fd_chunk_to_laddr( ctx->net_out_mem, ctx->net_out_chunk );
252252

253-
fd_memcpy( packet, ctx->hdr, sizeof(fd_net_hdrs_t) );
254-
fd_net_hdrs_t * hdr = (fd_net_hdrs_t *)packet;
255-
256-
hdr->udp->net_dport = dst_port;
257-
258-
memset( hdr->eth->dst, 0U, 6UL );
259-
memcpy( hdr->ip4->daddr_c, &dst_ip_addr, 4UL );
260-
hdr->ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
261-
hdr->ip4->check = 0U;
262-
hdr->ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
263-
hdr->ip4->check = fd_ip4_hdr_check_fast( hdr->buf+14 );
264-
265-
ulong packet_sz = payload_sz + sizeof(fd_net_hdrs_t);
266-
fd_memcpy( packet+sizeof(fd_net_hdrs_t), payload, payload_sz );
267-
hdr->udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
268-
hdr->udp->check = fd_ip4_udp_check( hdr->ip4->saddr,
269-
hdr->ip4->daddr,
270-
(fd_udp_hdr_t const *)(hdr->buf + 34),
271-
packet + sizeof(fd_net_hdrs_t) );
272-
273-
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
274-
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, FD_NETMUX_SIG_MIN_HDR_SZ );
253+
fd_ip4_udp_hdrs_t * hdr = (fd_ip4_udp_hdrs_t *)packet;
254+
*hdr = *ctx->hdr;
255+
256+
fd_ip4_hdr_t * ip4 = hdr->ip4;
257+
ip4->daddr = dst_ip_addr;
258+
ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
259+
ip4->check = 0U;
260+
ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
261+
ip4->check = fd_ip4_hdr_check_fast( ip4 );
262+
263+
fd_udp_hdr_t * udp = hdr->udp;
264+
udp->net_dport = dst_port;
265+
udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
266+
fd_memcpy( packet+sizeof(fd_ip4_udp_hdrs_t), payload, payload_sz );
267+
udp->check = 0U;
268+
269+
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
270+
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, sizeof(fd_ip4_udp_hdrs_t) );
271+
ulong packet_sz = payload_sz + sizeof(fd_ip4_udp_hdrs_t);
275272
fd_stem_publish( ctx->stem, 0UL, sig, ctx->net_out_chunk, packet_sz, 0UL, tsorig, tspub );
276273
ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, packet_sz, ctx->net_out_chunk0, ctx->net_out_wmark );
277274
}
@@ -907,7 +904,7 @@ unprivileged_init( fd_topo_t * topo,
907904

908905
ctx->net_id = (ushort)0;
909906

910-
fd_net_create_packet_header_template( ctx->hdr, FD_NET_MTU, ctx->gossip_my_addr.addr, ctx->gossip_listen_port );
907+
fd_ip4_udp_hdr_init( ctx->hdr, FD_NET_MTU, ctx->gossip_my_addr.addr, ctx->gossip_listen_port );
911908

912909
ctx->last_shred_dest_push_time = 0;
913910
ctx->restart_last_push_time = 0;

src/discof/repair/fd_repair_tile.c

+24-26
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ struct fd_repair_tile_ctx {
9191
ushort net_id;
9292
/* Includes Ethernet, IP, UDP headers */
9393
uchar buffer[ MAX_BUFFER_SIZE ];
94-
fd_net_hdrs_t intake_hdr[1];
95-
fd_net_hdrs_t serve_hdr[1];
94+
fd_ip4_udp_hdrs_t intake_hdr[1];
95+
fd_ip4_udp_hdrs_t serve_hdr [1];
9696

9797
fd_stake_ci_t * stake_ci;
9898

@@ -148,28 +148,26 @@ send_packet( fd_repair_tile_ctx_t * ctx,
148148
ulong payload_sz,
149149
ulong tsorig ) {
150150
uchar * packet = fd_chunk_to_laddr( ctx->net_out_mem, ctx->net_out_chunk );
151-
152-
fd_memcpy( packet, ( is_intake ? ctx->intake_hdr : ctx->serve_hdr ), sizeof(fd_net_hdrs_t) );
153-
fd_net_hdrs_t * hdr = (fd_net_hdrs_t *)packet;
154-
155-
hdr->ip4->saddr = src_ip_addr;
156-
hdr->ip4->daddr = dst_ip_addr;
157-
hdr->ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
158-
hdr->ip4->check = 0U;
159-
hdr->ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
160-
hdr->ip4->check = fd_ip4_hdr_check_fast( hdr->buf+14 );
161-
162-
ulong packet_sz = payload_sz + sizeof(fd_net_hdrs_t);
163-
fd_memcpy( packet+sizeof(fd_net_hdrs_t), payload, payload_sz );
164-
hdr->udp->net_dport = dst_port;
165-
hdr->udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
166-
hdr->udp->check = fd_ip4_udp_check( hdr->ip4->saddr,
167-
hdr->ip4->daddr,
168-
(fd_udp_hdr_t const *)(hdr->buf + 34),
169-
packet + sizeof(fd_net_hdrs_t) );
170-
171-
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
172-
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, FD_NETMUX_SIG_MIN_HDR_SZ );
151+
fd_ip4_udp_hdrs_t * hdr = (fd_ip4_udp_hdrs_t *)packet;
152+
*hdr = *(is_intake ? ctx->intake_hdr : ctx->serve_hdr);
153+
154+
fd_ip4_hdr_t * ip4 = hdr->ip4;
155+
ip4->saddr = src_ip_addr;
156+
ip4->daddr = dst_ip_addr;
157+
ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
158+
ip4->check = 0U;
159+
ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
160+
ip4->check = fd_ip4_hdr_check_fast( ip4 );
161+
162+
fd_udp_hdr_t * udp = hdr->udp;
163+
udp->net_dport = dst_port;
164+
udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
165+
fd_memcpy( packet+sizeof(fd_ip4_udp_hdrs_t), payload, payload_sz );
166+
hdr->udp->check = 0U;
167+
168+
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
169+
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, sizeof(fd_ip4_udp_hdrs_t) );
170+
ulong packet_sz = payload_sz + sizeof(fd_ip4_udp_hdrs_t);
173171
fd_mcache_publish( ctx->net_out_mcache, ctx->net_out_depth, ctx->net_out_seq, sig, ctx->net_out_chunk, packet_sz, 0UL, tsorig, tspub );
174172
ctx->net_out_seq = fd_seq_inc( ctx->net_out_seq, 1UL );
175173
ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, packet_sz, ctx->net_out_chunk0, ctx->net_out_wmark );
@@ -535,8 +533,8 @@ unprivileged_init( fd_topo_t * topo,
535533

536534
ctx->net_id = (ushort)0;
537535

538-
fd_net_create_packet_header_template( ctx->intake_hdr, FD_REPAIR_MAX_PACKET_SIZE, 0, ctx->repair_intake_listen_port );
539-
fd_net_create_packet_header_template( ctx->serve_hdr, FD_REPAIR_MAX_PACKET_SIZE, 0, ctx->repair_serve_listen_port );
536+
fd_ip4_udp_hdr_init( ctx->intake_hdr, FD_REPAIR_MAX_PACKET_SIZE, 0, ctx->repair_intake_listen_port );
537+
fd_ip4_udp_hdr_init( ctx->serve_hdr, FD_REPAIR_MAX_PACKET_SIZE, 0, ctx->repair_serve_listen_port );
540538

541539
/* Keyguard setup */
542540
fd_topo_link_t * sign_in = &topo->links[ tile->in_link_id[ SIGN_IN_IDX ] ];

src/discof/sender/fd_sender_tile.c

+21-22
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct fd_sender_tile_ctx {
4848
uchar txn_buf[ sizeof(fd_txn_p_t) ] __attribute__((aligned(alignof(fd_txn_p_t))));
4949

5050
fd_gossip_peer_addr_t tpu_serve_addr;
51-
fd_net_hdrs_t packet_hdr[ 1 ];
51+
fd_ip4_udp_hdrs_t packet_hdr[1];
5252
ushort net_id;
5353

5454
ulong stake_in_idx;
@@ -141,26 +141,25 @@ send_packet( fd_sender_tile_ctx_t * ctx,
141141
ulong tsorig ) {
142142
uchar * packet = fd_chunk_to_laddr( ctx->net_out_mem, ctx->net_out_chunk );
143143

144-
fd_memcpy( packet, ctx->packet_hdr, sizeof(fd_net_hdrs_t) );
145-
fd_net_hdrs_t * hdr = (fd_net_hdrs_t *)packet;
146-
147-
hdr->ip4->daddr = dst_ip_addr;
148-
hdr->ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
149-
hdr->ip4->check = 0U;
150-
hdr->ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
151-
hdr->ip4->check = fd_ip4_hdr_check_fast( hdr->buf+14 );
152-
153-
ulong packet_sz = payload_sz + sizeof(fd_net_hdrs_t);
154-
fd_memcpy( packet+sizeof(fd_net_hdrs_t), payload, payload_sz );
155-
hdr->udp->net_dport = fd_ushort_bswap( dst_port );
156-
hdr->udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
157-
hdr->udp->check = fd_ip4_udp_check( hdr->ip4->saddr,
158-
hdr->ip4->daddr,
159-
(fd_udp_hdr_t const *)hdr->buf+34,
160-
packet + sizeof(fd_net_hdrs_t) );
161-
162-
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
163-
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, FD_NETMUX_SIG_MIN_HDR_SZ );
144+
fd_ip4_udp_hdrs_t * hdr = (fd_ip4_udp_hdrs_t *)packet;
145+
*hdr = *ctx->packet_hdr;
146+
147+
fd_ip4_hdr_t * ip4 = hdr->ip4;
148+
ip4->daddr = dst_ip_addr;
149+
ip4->net_id = fd_ushort_bswap( ctx->net_id++ );
150+
ip4->check = 0U;
151+
ip4->net_tot_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_ip4_hdr_t)+sizeof(fd_udp_hdr_t)) );
152+
ip4->check = fd_ip4_hdr_check_fast( ip4 );
153+
154+
fd_udp_hdr_t * udp = hdr->udp;
155+
udp->net_dport = fd_ushort_bswap( dst_port );
156+
udp->net_len = fd_ushort_bswap( (ushort)(payload_sz + sizeof(fd_udp_hdr_t)) );
157+
fd_memcpy( packet+sizeof(fd_ip4_udp_hdrs_t), payload, payload_sz );
158+
udp->check = 0U;
159+
160+
ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
161+
ulong sig = fd_disco_netmux_sig( dst_ip_addr, dst_port, dst_ip_addr, DST_PROTO_OUTGOING, sizeof(fd_ip4_udp_hdrs_t) );
162+
ulong packet_sz = payload_sz + sizeof(fd_ip4_udp_hdrs_t);
164163
fd_mcache_publish( ctx->net_out_mcache, ctx->net_out_depth, ctx->net_out_seq, sig, ctx->net_out_chunk, packet_sz, 0UL, tsorig, tspub );
165164
ctx->net_out_seq = fd_seq_inc( ctx->net_out_seq, 1UL );
166165
ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, packet_sz, ctx->net_out_chunk0, ctx->net_out_wmark );
@@ -356,7 +355,7 @@ unprivileged_init( fd_topo_t * topo,
356355

357356
ctx->tpu_serve_addr.addr = tile->sender.ip_addr;
358357
ctx->tpu_serve_addr.port = fd_ushort_bswap( tile->sender.tpu_listen_port );
359-
fd_net_create_packet_header_template( ctx->packet_hdr, FD_TXN_MTU, ctx->tpu_serve_addr.addr, ctx->tpu_serve_addr.port );
358+
fd_ip4_udp_hdr_init( ctx->packet_hdr, FD_TXN_MTU, ctx->tpu_serve_addr.addr, ctx->tpu_serve_addr.port );
360359

361360
ulong poh_slot_obj_id = fd_pod_query_ulong( topo->props, "poh_slot", ULONG_MAX );
362361
FD_TEST( poh_slot_obj_id!=ULONG_MAX );

src/util/net/fd_ip4.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ union fd_ip4_hdr {
4343
uchar ttl; /* Frag time to live */
4444
uchar protocol; /* Type of payload */
4545
ushort check; /* Header checksum ("invariant" order) */
46-
union { /* Address of sender, technically net order but all APIs below work with this directly */
47-
uchar saddr_c[4];
46+
union __attribute__((packed)) {
47+
uchar saddr_c[4]; /* Address of sender, technically net order but all APIs below work with this directly */
4848
uint saddr;
4949
};
50-
union { /* Address of destination, technically net order but all APIs below work with this directly */
51-
uchar daddr_c[4];
50+
union __attribute__((packed)) {
51+
uchar daddr_c[4]; /* Address of destination, technically net order but all APIs below work with this directly */
5252
uint daddr;
5353
};
5454
/* Up to 40 bytes of options here */

0 commit comments

Comments
 (0)