1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

s3: nmbd: Now attrs array mirrors fd's array use it in preference.

This will allow us to eventually remove source3/lib/events.c
dependency and make nmbd purely tevent based.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison 2016-09-23 12:16:58 -07:00 committed by Volker Lendecke
parent 7f0717e751
commit 376e04656b

View File

@ -2004,7 +2004,7 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
client_port = DGRAM_PORT;
}
packet = read_packet(fds[i].fd, packet_type);
packet = read_packet(attrs[i].fd, packet_type);
if (!packet) {
continue;
}
@ -2014,7 +2014,7 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
* only is set then check it came from one of our local nets.
*/
if (lp_bind_interfaces_only() &&
(fds[i].fd == client_fd) &&
(attrs[i].fd == client_fd) &&
(!is_local_net_v4(packet->ip))) {
DEBUG(7,("discarding %s packet sent to broadcast socket from %s:%d\n",
packet_name, inet_ntoa(packet->ip), packet->port));
@ -2053,10 +2053,10 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
if (attrs[i].broadcast) {
/* this is a broadcast socket */
packet->send_fd = fds[i-1].fd;
packet->send_fd = attrs[i-1].fd;
} else {
/* this is already a unicast socket */
packet->send_fd = fds[i].fd;
packet->send_fd = attrs[i].fd;
}
queue_packet(packet);