diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netgraph/bluetooth/drivers/h4/ng_h4.c | 4 | ||||
-rw-r--r-- | sys/netgraph/bluetooth/include/ng_btsocket.h | 7 | ||||
-rw-r--r-- | sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c index 971079f..8ea68ed 100644 --- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c +++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c @@ -150,7 +150,7 @@ static int ng_h4_node = 0; static int ng_h4_open(dev_t dev, struct tty *tp) { - char name[NG_NODELEN + 1]; + char name[NG_NODESIZ]; ng_h4_info_p sc = NULL; int s, error; @@ -733,7 +733,7 @@ static int ng_h4_shutdown(node_p node) { ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node); - char name[NG_NODELEN + 1]; + char name[NG_NODESIZ]; /* Let old node go */ NG_NODE_SET_PRIVATE(node, NULL); diff --git a/sys/netgraph/bluetooth/include/ng_btsocket.h b/sys/netgraph/bluetooth/include/ng_btsocket.h index 6bdc607..1e351d0 100644 --- a/sys/netgraph/bluetooth/include/ng_btsocket.h +++ b/sys/netgraph/bluetooth/include/ng_btsocket.h @@ -50,12 +50,17 @@ /* * XXX FIXME: probably does not belong here * Bluetooth version of struct sockaddr for raw HCI sockets + * + * XXX: sizeof(hci_node) was NG_NODELEN + 1, but NG_NODESIZ (the equivalent + * of NG_NODELEN + 1) has been bumped to 32. The code currently + * truncates the node name to sizeof(hci_node), although it would be + * possible to correctly handle this by means of the hci_len field. */ struct sockaddr_hci { u_char hci_len; /* total length */ u_char hci_family; /* address family */ - char hci_node[16]; /* address (size == NG_NODELEN + 1) */ + char hci_node[16]; /* address */ }; /* Raw HCI socket options */ diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index a07b0b6..dd46231 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -1009,7 +1009,7 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) { ng_btsocket_hci_raw_pcb_p pcb = so2hci_raw_pcb(so); - char path[NG_NODELEN + 2]; + char path[NG_NODESIZ + 1]; struct ng_mesg *msg = NULL; int error = 0; |