From 4b2d32e1fe19c4b84d925bc1d6bb2bd0e39cb156 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 28 Jun 2004 10:57:18 +0000 Subject: Set olen before calling getsockopt() --- pand/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pand/main.c') diff --git a/pand/main.c b/pand/main.c index d4a29867..9dfa18a1 100644 --- a/pand/main.c +++ b/pand/main.c @@ -136,6 +136,7 @@ static int do_listen(void) } /* Setup L2CAP options according to BNEP spec */ + olen = sizeof(l2o); if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen) < 0) { syslog(LOG_ERR, "Failed to get L2CAP options. %s(%d)", strerror(errno), errno); @@ -257,6 +258,7 @@ static int create_connection(char *dst, bdaddr_t *bdaddr) } /* Setup L2CAP options according to BNEP spec */ + olen = sizeof(l2o); getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen); l2o.imtu = l2o.omtu = BNEP_MTU; setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)); -- cgit