summaryrefslogtreecommitdiff
path: root/source4/nbt_server/packet.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-18 16:36:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:17 -0500
commiteead6d310b2f10a8933077f5b12131f0bb1aae02 (patch)
treec98cfcef7a09d123eba3e6c0d563bddf9d8c4275 /source4/nbt_server/packet.c
parentc63937a1c0d82917f6e33174ab321da07e416c45 (diff)
downloadsamba-eead6d310b2f10a8933077f5b12131f0bb1aae02.tar.gz
samba-eead6d310b2f10a8933077f5b12131f0bb1aae02.tar.bz2
samba-eead6d310b2f10a8933077f5b12131f0bb1aae02.zip
r13007: let our winsclient code register multihomed records with
our winsserver and don't defend our local name against our own register packets... this won gave quite confusing logmessages... metze (This used to be commit 31ce24d7b1d2945c45c4f5d6376d5041df8b6982)
Diffstat (limited to 'source4/nbt_server/packet.c')
-rw-r--r--source4/nbt_server/packet.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c
index 8909d7bbc4..d73a3b027a 100644
--- a/source4/nbt_server/packet.c
+++ b/source4/nbt_server/packet.c
@@ -41,28 +41,43 @@ 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(struct nbt_name_socket *nbtsock,
- struct nbt_name_packet *packet,
- const struct socket_address *src)
+BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *packet,
+ const struct socket_address *src)
{
struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
struct nbtd_interface);
- struct nbtd_server *nbtsrv = iface->nbtsrv;
-
+
/* if its not a broadcast then its not considered a self packet */
if (!(packet->operation & NBT_FLAG_BROADCAST)) {
return False;
}
- /* if its not from the nbt port, then it wasn't a broadcast from us */
- if (src->port != lp_nbt_port()) {
+ /*
+ * this uses the fact that iface->nbtsock is the unicast listen address
+ * if the interface isn't the global bcast interface
+ *
+ * so if the request was directed to the unicast address it isn't a broadcast
+ * message
+ */
+ if (iface->nbtsock == nbtsock &&
+ iface != iface->nbtsrv->bcast_interface) {
return False;
}
- /* this uses the fact that iface->nbtsock is our non-broadcast
- listen address */
- if (iface->nbtsock == nbtsock &&
- iface != iface->nbtsrv->bcast_interface) {
+ return nbtd_self_packet(nbtsock, packet, src);
+}
+
+BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *packet,
+ const struct socket_address *src)
+{
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ 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;
}