+ /* Create an (ICMP) raw socket for writing (we'll check errors later) */
+ rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
+ raw_eno = errno;
+ udpsock = -1;
+
+ /* drop root rights */
+ uid = getuid ();
+#ifdef HAVE_SETRESUID
+ if (0 != setresuid (uid, uid, uid))
+ {
+ fprintf (stderr, "Failed to setresuid: %s\n", strerror (errno));
+ global_ret = 1;
+ goto error_exit;
+ }
+#else
+ if (0 != (setuid (uid) | seteuid (uid)))
+ {
+ fprintf (stderr, "Failed to setuid: %s\n", strerror (errno));
+ global_ret = 2;
+ goto error_exit;
+ }
+#endif
+
+ /* Now that we run without root rights, we can do error checking... */