diff options
Diffstat (limited to 'source4/nbt_server/packet.c')
-rw-r--r-- | source4/nbt_server/packet.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c index 09b2549956..6b8e266f6d 100644 --- a/source4/nbt_server/packet.c +++ b/source4/nbt_server/packet.c @@ -23,6 +23,7 @@ #include "nbt_server/nbt_server.h" #include "lib/socket/socket.h" #include "librpc/gen_ndr/ndr_nbt.h" +#include "param/param.h" /* we received a badly formed packet - log it @@ -41,7 +42,7 @@ void nbtd_bad_packet(struct nbt_name_packet *packet, see if an incoming packet is a broadcast packet from one of our own interfaces */ -BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, +bool nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, const struct socket_address *src) { @@ -50,7 +51,7 @@ BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, /* if its not a broadcast then its not considered a self packet */ if (!(packet->operation & NBT_FLAG_BROADCAST)) { - return False; + return false; } /* @@ -62,13 +63,13 @@ BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, */ if (iface->nbtsock == nbtsock && iface != iface->nbtsrv->bcast_interface) { - return False; + return false; } return nbtd_self_packet(nbtsock, packet, src); } -BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock, +bool nbtd_self_packet(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, const struct socket_address *src) { @@ -77,19 +78,19 @@ BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock, struct nbtd_server *nbtsrv = iface->nbtsrv; /* if its not from the nbt port, then it wasn't a broadcast from us */ - if (src->port != lp_nbt_port()) { - return False; + if (src->port != lp_nbt_port(global_loadparm)) { + return false; } /* we have to loop over our interface list, seeing if its from one of our own interfaces */ for (iface=nbtsrv->interfaces;iface;iface=iface->next) { if (strcmp(src->addr, iface->ip_address) == 0) { - return True; + return true; } } - return False; + return false; } @@ -326,7 +327,7 @@ void nbtd_wack_reply(struct nbt_name_socket *nbtsock, packet->answers[0].rr_class = NBT_QCLASS_IP; packet->answers[0].ttl = ttl; packet->answers[0].rdata.data.length = 2; - packet->answers[0].rdata.data.data = talloc_size(packet, 2); + packet->answers[0].rdata.data.data = talloc_array(packet, uint8_t, 2); if (packet->answers[0].rdata.data.data == NULL) goto failed; RSSVAL(packet->answers[0].rdata.data.data, 0, request_packet->operation); |