Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/libbb/create_icmp6_socket.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/libbb/create_icmp6_socket.c
r821 r1770 8 8 */ 9 9 10 #include <sys/types.h> 11 #include <netdb.h> 12 #include <sys/socket.h> 13 #include <errno.h> 14 #include <unistd.h> 10 //#include <sys/types.h> 11 //#include <netdb.h> 12 //#include <sys/socket.h> 15 13 #include "libbb.h" 16 14 17 #if def CONFIG_FEATURE_IPV615 #if ENABLE_FEATURE_IPV6 18 16 int create_icmp6_socket(void) 19 17 { … … 24 22 /* if getprotobyname failed, just silently force 25 23 * proto->p_proto to have the correct value for "ipv6-icmp" */ 26 if ((sock = socket(AF_INET6, SOCK_RAW, 27 (proto ? proto->p_proto : IPPROTO_ICMPV6))) < 0) { 24 sock = socket(AF_INET6, SOCK_RAW, 25 (proto ? proto->p_proto : IPPROTO_ICMPV6)); 26 if (sock < 0) { 28 27 if (errno == EPERM) 29 28 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); 30 else 31 bb_perror_msg_and_die(bb_msg_can_not_create_raw_socket); 29 bb_perror_msg_and_die(bb_msg_can_not_create_raw_socket); 32 30 } 33 31 34 32 /* drop root privs if running setuid */ 35 setuid(getuid());33 xsetuid(getuid()); 36 34 37 35 return sock;
Note:
See TracChangeset
for help on using the changeset viewer.