diff options
author | Jeremy Allison <jra@samba.org> | 2020-08-24 12:00:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-08-25 16:21:32 +0000 |
commit | 5151278ccc1d36ec8a62ecc7a55de50bd591c3d3 (patch) | |
tree | 486ce9e78abeb04bbe044fd7f2067a7d0ed5acda /source3 | |
parent | 189c741052f09ec2fd1aff52cdd006ae5a42af20 (diff) | |
download | samba-5151278ccc1d36ec8a62ecc7a55de50bd591c3d3.tar.gz |
s3: libsmb: Cleanup - Remove a union in sock_packet_read_got_socket() that was an early attempt a samba_sockaddr.
Just use samba_sockaddr.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/namequery.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index a69f48d7ba0..89b217f1161 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -442,10 +442,7 @@ static void sock_packet_read_got_socket(struct tevent_req *subreq) subreq, struct tevent_req); struct sock_packet_read_state *state = tevent_req_data( req, struct sock_packet_read_state); - union { - struct sockaddr sa; - struct sockaddr_in sin; - } addr; + struct samba_sockaddr addr = {0}; ssize_t ret; ssize_t received; int err; @@ -474,8 +471,8 @@ static void sock_packet_read_got_socket(struct tevent_req *subreq) goto retry; } ret = tsocket_address_bsd_sockaddr(state->addr, - &addr.sa, - sizeof(addr.sin)); + &addr.u.sa, + sizeof(addr.u.in)); if (ret == -1) { tevent_req_nterror(req, map_nt_error_from_unix(errno)); return; @@ -483,7 +480,7 @@ static void sock_packet_read_got_socket(struct tevent_req *subreq) state->packet = parse_packet_talloc( state, (char *)state->buf, received, state->type, - addr.sin.sin_addr, addr.sin.sin_port); + addr.u.in.sin_addr, addr.u.in.sin_port); if (state->packet == NULL) { DEBUG(10, ("parse_packet failed\n")); goto retry; |