You know, I have heard that about pigs; they know which snakes to avoid, like as you mentioned, cottonmouths.
However, out in these here parts (the wide prairies of Nebraska), they are known to chow down rattlesnakes.
My knowledge of snakery is chaotic and incomplete; could it be that the poison of cottonmouths is more lethal than the venom of rattlesnakes, and the pigs know it?
A cottonmouth stinks, a real stench, very unpleasent odor. I believe that has more to do with it.