I had to write as part of a program the ability to ping other machines for some kind of diagnosics.
Disseminating the ping code and using it mine, I managed to get the ping working how i wanted, but only under root access, which i really didn't want to permanently use.
Searching the net I saw something about capabilities and CAP_NET_RAW, but couldn't find anywhere which explained what the hell they were or how to use it. I also could find anywhere else which had a workaround for it.
Then i though a bit laterally... if ping could why can't my program?
simple, copy the ping properties over using chmod
chmod --reference=/bin/ping <your exec>
Bingo! worked a charm