(sorry i kep having thoughts on your situation) the calmer you are hen you speak to him, the better. Sometimes, guys need to be talked to as if they are children, when they feel comforted for something, thy tend to be more submissive. Good luck!
make sure when you speak with him that it's in a private and quiet setting. Perhaps when you're laying in bed together at night, that way after your talk you can have the chance to have sex and engage in some sexual acivity together.
Remember that masturbation is a natural thing, and unless it's a big problem in his life or in your relationship, it shouldn't be a problem at all. The porn, I would hate that too, but some women say it doesn't bother them.... I guess that's something you'll have to talk with him about as well. Tell him your concerns for your daughter. Guys look at porn... plain and simple.
I understand your concerns, however, he IS a man with his own sexual needs. How often are you having sex? Sex is like a drug, and can be very addicting for some. He is probably embarrassed to tell you that he's been doing this, especially if he's being "caught" but if he was in the army, masturbation was probably his only liberation and obviously the only action he was getting. Once a person masturbates profusely, it becomes a bit addicting and then a hard habit to break.Now, I don't know if he recently came back from a deployment or he's been home for a while.
Sit and speak with him very calmly and in an understanding, not degrading or threatening, way and explain to him that it's ok to masturbate, but to please do it in the shower or bathroom. You may even try to discourage the action by offering him sex rather than masturbation, or saying that it turns you on that he's excited and wants to relieve himself... maybe you could help with him that. After he realizes that he's not being threatened or shunned for it, maybe he won't feel so compelled to do it.