The paper proposes a distributed stateful IPv6 address configuration scheme for 6LoWPAN wireless sensor networks. In the scheme, each sensor node has a unique IPv6 address space for assignment and can allocate a unique IPv6 address for other nodes, so the distributed IPv6 address configuration is achieved and the address configuration for multiple sensor nodes is performed in parallel, which reduces the addressing cost and delay. Moreover, the paper proposes an IPv6 address recovery algorithm. If a node fails, the algorithm can automatically maintain and repair the topology of the k-way tree where the failed node locates in order to ensure that its descendants can work normally. Finally, this scheme is compared with existing scheme LISAA and the simulation results show that the addressing cost and delay are reduced by approximate 44% and 40%, respectively.