I was having a similar problem on my Sprint HTC One M8 after upgrading to Marshmallow. The problem happened on every wifi I would connect to... work, home, a friend's place, etc. After trying out several things, I finally fixed it by uninstalling "Sprint Connections Optimizer". I tried...