wok diff busybox/stuff/busybox-1.30-diet.u @ rev 20654
busybox: add cook workaround
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jan 13 11:19:21 2019 +0100 (2019-01-13) |
parents | |
children | ffd273a61556 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.30-diet.u Sun Jan 13 11:19:21 2019 +0100 1.3 @@ -0,0 +1,111 @@ 1.4 +--- busybox-1.30/include/platform.h 1.5 ++++ busybox-1.30/include/platform.h 1.6 +@@ -533,6 +533,21 @@ 1.7 + # undef HAVE_PRINTF_PERCENTM 1.8 + #endif 1.9 + 1.10 ++#if defined(__dietlibc__) 1.11 ++# define __aligned_u64 __u64 __attribute__((aligned(8))) 1.12 ++# define LOOP_SET_STATUS64 0x4C04 1.13 ++# define LOOP_GET_STATUS64 0x4C05 1.14 ++# define MAXSYMLINKS 20 1.15 ++# define S_TYPEISMQ(x) 0 1.16 ++# define S_TYPEISSEM(x) 0 1.17 ++# define S_TYPEISSHM(x) 0 1.18 ++# define O_CLOEXEC 0 1.19 ++# undef HAVE_STRVERSCMP 1.20 ++# undef HAVE_DPRINTF 1.21 ++# undef HAVE_STRCASESTR 1.22 ++# define ttyname_r(a,b,c) (strlcpy(b, ttyname(a), c) == 0) 1.23 ++#endif 1.24 ++ 1.25 + /* 1.26 + * Now, define prototypes for all the functions defined in platform.c 1.27 + * These must come after all the HAVE_* macros are defined (or not) 1.28 +--- busybox-1.30/networking/ping.c 1.29 ++++ busybox-1.30/networking/ping.c 1.30 +@@ -123,6 +124,84 @@ 1.31 + #include "libbb.h" 1.32 + #include "common_bufsiz.h" 1.33 + 1.34 ++#ifdef __dietlibc__ 1.35 ++/* Dietlibc is missing the BSD definition 'struct icmp' */ 1.36 ++/* 1.37 ++ * Internal of an ICMP Router Advertisement 1.38 ++ */ 1.39 ++struct icmp_ra_addr 1.40 ++{ 1.41 ++ uint32_t ira_addr; 1.42 ++ uint32_t ira_preference; 1.43 ++}; 1.44 ++ 1.45 ++struct icmp 1.46 ++{ 1.47 ++ uint8_t icmp_type; /* type of message, see below */ 1.48 ++ uint8_t icmp_code; /* type sub code */ 1.49 ++ uint16_t icmp_cksum; /* ones complement checksum of struct */ 1.50 ++ union 1.51 ++ { 1.52 ++ uint8_t ih_pptr; /* ICMP_PARAMPROB */ 1.53 ++ struct in_addr ih_gwaddr; /* gateway address */ 1.54 ++ struct ih_idseq /* echo datagram */ 1.55 ++ { 1.56 ++ uint16_t icd_id; 1.57 ++ uint16_t icd_seq; 1.58 ++ } ih_idseq; 1.59 ++ uint32_t ih_void; 1.60 ++ 1.61 ++ /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ 1.62 ++ struct ih_pmtu 1.63 ++ { 1.64 ++ uint16_t ipm_void; 1.65 ++ uint16_t ipm_nextmtu; 1.66 ++ } ih_pmtu; 1.67 ++ 1.68 ++ struct ih_rtradv 1.69 ++ { 1.70 ++ uint8_t irt_num_addrs; 1.71 ++ uint8_t irt_wpa; 1.72 ++ uint16_t irt_lifetime; 1.73 ++ } ih_rtradv; 1.74 ++ } icmp_hun; 1.75 ++#define icmp_pptr icmp_hun.ih_pptr 1.76 ++#define icmp_gwaddr icmp_hun.ih_gwaddr 1.77 ++#define icmp_id icmp_hun.ih_idseq.icd_id 1.78 ++#define icmp_seq icmp_hun.ih_idseq.icd_seq 1.79 ++#define icmp_void icmp_hun.ih_void 1.80 ++#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void 1.81 ++#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu 1.82 ++#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs 1.83 ++#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa 1.84 ++#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime 1.85 ++ union 1.86 ++ { 1.87 ++ struct 1.88 ++ { 1.89 ++ uint32_t its_otime; 1.90 ++ uint32_t its_rtime; 1.91 ++ uint32_t its_ttime; 1.92 ++ } id_ts; 1.93 ++ struct 1.94 ++ { 1.95 ++ struct ip idi_ip; 1.96 ++ /* options and then 64 bits of data */ 1.97 ++ } id_ip; 1.98 ++ struct icmp_ra_addr id_radv; 1.99 ++ uint32_t id_mask; 1.100 ++ uint8_t id_data[1]; 1.101 ++ } icmp_dun; 1.102 ++#define icmp_otime icmp_dun.id_ts.its_otime 1.103 ++#define icmp_rtime icmp_dun.id_ts.its_rtime 1.104 ++#define icmp_ttime icmp_dun.id_ts.its_ttime 1.105 ++#define icmp_ip icmp_dun.id_ip.idi_ip 1.106 ++#define icmp_radv icmp_dun.id_radv 1.107 ++#define icmp_mask icmp_dun.id_mask 1.108 ++#define icmp_data icmp_dun.id_data 1.109 ++}; 1.110 ++#endif /* __dietlibc__ */ 1.111 ++ 1.112 + #ifdef __BIONIC__ 1.113 + /* should be in netinet/ip_icmp.h */ 1.114 + # define ICMP_DEST_UNREACH 3 /* Destination Unreachable */