Sounds like he had wet ear and most likely it's developed into an ear infection. You need to go to the Vet. If you can't, go to Petsmart and get Chlorhexaderm Flush. It's a cleansing and drying agent for ears. Clean the ear and clear it of all the debris that you can. Lay the dog on his side, apply the flush into the ear, hold the dog down (it feels weird and he'll try to escape) and massage it into the ear canal (under the ear on the neck). Hold the dog down for a mine so it can soak down in. Let him up and stand back - he'll shake his head furiously and the excess flush will come out. You don't want to ferry spayed. Use it twice a day. It should clear up in a few days. If his ear is still bothering him, you must go to the Vet - no choice.
You should consult a veterinarian for treatment as it could be caused by: an ear infection, food allergies or parasites like fleas, mites or ticks. The ear condition could cause aggression or restlessness as a result of the dog being irritated and hence the urgency for medical attention.