The most important weakness we had in Viet Nam was our Cold war fear of the USSR. That kept us from mining Haiphong and a full blockade of war material. The war would have been over by 1967, no Tet, no Cambodia but we would still be garrisoning S Viet Nam ala S Korea.
Our biggest weakness in Afghanistan is the safe haven in Pakistan with open cooperation between the Haqqani's and Pakistan Army. The enemy in Afghanistan could be defeated in one year by crop dusting Roundup Herbacide on all the poppies and arresting Karzai and his corrupt entourage and replacing it with a NATO administration.
True, Viet Nam is not Afghanistan, but the bitter results will be the same if our warfighting leadership, Obama and Congress, does not do its duty and fight the enemy where the enemy is, and destroy the enemies hiding places and logistical support.
If we can't do that, pull back to garrisons, do raids and UAV strikes, bribe everyone for information and minimize our own losses.