From f55ea8bb3dca868e21663cd90eaea7a35cd7886c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 9 Jan 2006 22:12:53 +0000 Subject: r12804: This patch reworks the Samba4 sockets layer to use a socket_address structure that is more generic than just 'IP/port'. It now passes make test, and has been reviewed and updated by metze. (Thankyou *very* much). This passes 'make test' as well as kerberos use (not currently in the testsuite). The original purpose of this patch was to have Samba able to pass a socket address stucture from the BSD layer into the kerberos routines and back again. It also removes nbt_peer_addr, which was being used for a similar purpose. It is a large change, but worthwhile I feel. Andrew Bartlett (This used to be commit 88198c4881d8620a37086f80e4da5a5b71c5bbb2) --- source4/nbt_server/wins/wins_dns_proxy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source4/nbt_server/wins/wins_dns_proxy.c') diff --git a/source4/nbt_server/wins/wins_dns_proxy.c b/source4/nbt_server/wins/wins_dns_proxy.c index 23dfa19cc6..540f4e2c38 100644 --- a/source4/nbt_server/wins/wins_dns_proxy.c +++ b/source4/nbt_server/wins/wins_dns_proxy.c @@ -31,7 +31,7 @@ struct wins_dns_proxy_state { struct nbt_name_socket *nbtsock; struct nbt_name_packet *packet; - struct nbt_peer_socket src; + struct socket_address *src; }; static void nbtd_wins_dns_proxy_handler(struct composite_context *creq) @@ -53,11 +53,11 @@ static void nbtd_wins_dns_proxy_handler(struct composite_context *creq) talloc_steal(s->packet, addresses); if (!addresses) goto notfound; - nbtd_name_query_reply(s->nbtsock, s->packet, &s->src, name, + nbtd_name_query_reply(s->nbtsock, s->packet, s->src, name, 0, nb_flags, addresses); return; notfound: - nbtd_negative_name_query_reply(s->nbtsock, s->packet, &s->src); + nbtd_negative_name_query_reply(s->nbtsock, s->packet, s->src); } /* @@ -65,7 +65,7 @@ notfound: */ void nbtd_wins_dns_proxy_query(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, - const struct nbt_peer_socket *src) + struct socket_address *src) { struct nbt_name *name = &packet->questions[0].name; struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, @@ -81,8 +81,10 @@ void nbtd_wins_dns_proxy_query(struct nbt_name_socket *nbtsock, if (!s) goto failed; s->nbtsock = nbtsock; s->packet = talloc_steal(s, packet); - s->src = *src; - talloc_steal(s, src->addr); + s->src = src; + if (!talloc_reference(s, src)) { + goto failed; + } creq = resolve_name_send(name, iface->nbtsrv->task->event_ctx, methods); if (!creq) goto failed; -- cgit