Module Name:    src
Committed By:   plunky
Date:           Thu Jan 27 12:19:48 UTC 2011

Modified Files:
        src/usr.sbin/btpand: bnep.c

Log Message:
when a BNEP channel is opened, clear any NetType or MulticastAddress
filters that may be in effect at the remote side.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btpand/bnep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/btpand/bnep.c
diff -u src/usr.sbin/btpand/bnep.c:1.8 src/usr.sbin/btpand/bnep.c:1.9
--- src/usr.sbin/btpand/bnep.c:1.8	Tue May 12 21:08:30 2009
+++ src/usr.sbin/btpand/bnep.c	Thu Jan 27 12:19:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bnep.c,v 1.8 2009/05/12 21:08:30 plunky Exp $	*/
+/*	$NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2008 Iain Hibbert
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bnep.c,v 1.8 2009/05/12 21:08:30 plunky Exp $");
+__RCSID("$NetBSD: bnep.c,v 1.9 2011/01/27 12:19:48 plunky Exp $");
 
 #include <bluetooth.h>
 #include <sdp.h>
@@ -370,6 +370,10 @@
 	    ether_ntoa((struct ether_addr *)chan->raddr), rsp);
 
 	bnep_send_control(chan, BNEP_SETUP_CONNECTION_RESPONSE, rsp);
+	if (rsp == BNEP_SETUP_SUCCESS) {
+		bnep_send_control(chan, BNEP_FILTER_NET_TYPE_SET);
+		bnep_send_control(chan, BNEP_FILTER_MULTI_ADDR_SET);
+	}
 	return (len * 2 + 1);
 }
 
@@ -394,6 +398,8 @@
 	if (rsp == BNEP_SETUP_SUCCESS) {
 		chan->state = CHANNEL_OPEN;
 		channel_timeout(chan, 0);
+		bnep_send_control(chan, BNEP_FILTER_NET_TYPE_SET);
+		bnep_send_control(chan, BNEP_FILTER_MULTI_ADDR_SET);
 	} else {
 		chan->down(chan);
 	}
@@ -480,7 +486,6 @@
 		log_err("filter_net_type: addr %s response 0x%2.2x",
 		    ether_ntoa((struct ether_addr *)chan->raddr), rsp);
 
-	/* we did not send any filter_net_type_set message */
 	return 2;
 }
 
@@ -570,7 +575,6 @@
 		log_err("filter_multi_addr: addr %s response 0x%2.2x",
 		    ether_ntoa((struct ether_addr *)chan->raddr), rsp);
 
-	/* we did not send any filter_multi_addr_set message */
 	return 2;
 }
 
@@ -613,8 +617,12 @@
 		p += 2;
 		break;
 
-	case BNEP_FILTER_NET_TYPE_SET:		/* TODO */
-	case BNEP_FILTER_MULTI_ADDR_SET:	/* TODO */
+	case BNEP_FILTER_NET_TYPE_SET:
+	case BNEP_FILTER_MULTI_ADDR_SET:
+		be16enc(p, 0);	/* just clear filters for now */
+		p += 2;
+		break;
+
 	default:
 		log_err("Can't send control type 0x%2.2x", type);
 		break;

Reply via email to