summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-01 05:09:29 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-01 05:09:29 +0000
commit2e917ea040d85f06b8e40b6fd178c08ee84797c9 (patch)
tree4ecdc6b6bb7757e92bbf8516bc670e967f7331f4 /source3/libsmb/nmblib.c
parentfd8d5e56af81277030137e4d59296ce133dd4906 (diff)
downloadsamba-2e917ea040d85f06b8e40b6fd178c08ee84797c9.tar.gz
samba-2e917ea040d85f06b8e40b6fd178c08ee84797c9.tar.bz2
samba-2e917ea040d85f06b8e40b6fd178c08ee84797c9.zip
sort name query responses by how far they are from our interface
broadcast addresses. This makes it far more likely that we will try to talk to an interface that is routable from one of our interfaces. (This used to be commit bc1a0506868266088ae585a7a5dcb1ac8ca3474d)
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r--source3/libsmb/nmblib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 9a37b4252a..ba0d8cee5d 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -1045,7 +1045,7 @@ BOOL match_mailslot_name(struct packet_struct *p, char *mailslot_name)
/****************************************************************************
return the number of bits that match between two 4 character buffers
***************************************************************************/
-static int matching_bits(uchar *p1, uchar *p2)
+int matching_quad_bits(uchar *p1, uchar *p2)
{
int i, j, ret = 0;
for (i=0; i<4; i++) {
@@ -1071,7 +1071,7 @@ compare two query reply records
***************************************************************************/
static int name_query_comp(uchar *p1, uchar *p2)
{
- return matching_bits(p2+2, sort_ip) - matching_bits(p1+2, sort_ip);
+ return matching_quad_bits(p2+2, sort_ip) - matching_quad_bits(p1+2, sort_ip);
}
/****************************************************************************