package/busybox/patches/241-udhcpc-oversized_packets.patch |
1 | | diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c |
2 | | index 2b7528c..94e53dc 100644 |
3 | 1 | --- a/networking/udhcp/packet.c |
4 | 2 | +++ b/networking/udhcp/packet.c |
5 | | @@ -165,6 +165,11 @@ uint16_t FAST_FUNC udhcp_checksum(void *addr, int count) |
| 3 | @@ -165,6 +165,11 @@ uint16_t FAST_FUNC udhcp_checksum(void * |
6 | 4 | return ~sum; |
7 | 5 | } |
8 | 6 | |
... | ... | |
14 | 12 | /* Construct a ip/udp header for a packet, send packet */ |
15 | 13 | int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, |
16 | 14 | uint32_t source_nip, int source_port, |
17 | | @@ -173,10 +178,10 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, |
| 15 | @@ -173,10 +178,10 @@ int FAST_FUNC udhcp_send_raw_packet(stru |
18 | 16 | { |
19 | 17 | struct sockaddr_ll dest_sll; |
20 | 18 | struct ip_udp_dhcp_packet packet; |
... | ... | |
26 | 24 | |
27 | 25 | fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); |
28 | 26 | if (fd < 0) { |
29 | | @@ -185,8 +190,8 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, |
| 27 | @@ -185,8 +190,8 @@ int FAST_FUNC udhcp_send_raw_packet(stru |
30 | 28 | } |
31 | 29 | |
32 | 30 | memset(&dest_sll, 0, sizeof(dest_sll)); |
... | ... | |
37 | 35 | |
38 | 36 | dest_sll.sll_family = AF_PACKET; |
39 | 37 | dest_sll.sll_protocol = htons(ETH_P_IP); |
40 | | @@ -199,36 +204,24 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, |
| 38 | @@ -199,36 +204,24 @@ int FAST_FUNC udhcp_send_raw_packet(stru |
41 | 39 | goto ret_close; |
42 | 40 | } |
43 | 41 | |
... | ... | |
80 | 78 | (struct sockaddr *) &dest_sll, sizeof(dest_sll)); |
81 | 79 | msg = "sendto"; |
82 | 80 | ret_close: |
83 | | @@ -246,7 +239,6 @@ int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, |
| 81 | @@ -246,7 +239,6 @@ int FAST_FUNC udhcp_send_kernel_packet(s |
84 | 82 | uint32_t dest_nip, int dest_port) |
85 | 83 | { |
86 | 84 | struct sockaddr_in client; |
... | ... | |
88 | 86 | int fd; |
89 | 87 | int result = -1; |
90 | 88 | const char *msg; |
91 | | @@ -277,9 +269,7 @@ int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, |
| 89 | @@ -277,9 +269,7 @@ int FAST_FUNC udhcp_send_kernel_packet(s |
92 | 90 | } |
93 | 91 | |
94 | 92 | udhcp_dump_packet(dhcp_pkt); |
package/busybox/patches/242-udhcpc_msgs.patch |
1 | 1 | --- a/networking/udhcp/dhcpc.c |
2 | 2 | +++ b/networking/udhcp/dhcpc.c |
3 | | @@ -428,6 +428,7 @@ static int raw_bcast_from_client_config_ |
4 | | static int send_discover(uint32_t xid, uint32_t requested) |
| 3 | @@ -436,6 +436,7 @@ static int raw_bcast_from_client_config_ |
| 4 | static NOINLINE int send_discover(uint32_t xid, uint32_t requested) |
5 | 5 | { |
6 | 6 | struct dhcp_packet packet; |
7 | 7 | + static int msgs = 0; |
8 | 8 | |
9 | | init_packet(&packet, DHCPDISCOVER); |
10 | | packet.xid = xid; |
11 | | @@ -438,6 +439,7 @@ static int send_discover(uint32_t xid, u |
12 | | udhcp_add_simple_option(&packet, DHCP_MAX_SIZE, htons(576)); |
| 9 | /* Fill in: op, htype, hlen, cookie, chaddr fields, |
| 10 | * random xid field (we override it below), |
| 11 | @@ -453,6 +454,7 @@ static NOINLINE int send_discover(uint32 |
| 12 | */ |
13 | 13 | add_client_options(&packet); |
14 | 14 | |
15 | 15 | + if (msgs++ < 3) |
package/busybox/patches/300-netmsg.patch |
1 | | diff --git a/include/applets.src.h b/include/applets.src.h |
2 | | index f4fab53..f97f2d8 100644 |
3 | 1 | --- a/include/applets.src.h |
4 | 2 | +++ b/include/applets.src.h |
5 | | @@ -256,6 +256,7 @@ IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_DROP)) |
| 3 | @@ -256,6 +256,7 @@ IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_D |
6 | 4 | IF_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_DROP)) |
7 | 5 | IF_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_DROP)) |
8 | 6 | IF_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_DROP)) |
... | ... | |
10 | 8 | IF_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_DROP)) |
11 | 9 | IF_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_DROP)) |
12 | 10 | IF_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_DROP)) |
13 | | diff --git a/include/usage.src.h b/include/usage.src.h |
14 | | index 30fef24..ac78992 100644 |
15 | 11 | --- a/include/usage.src.h |
16 | 12 | +++ b/include/usage.src.h |
17 | 13 | @@ -1,3 +1,4 @@ |
... | ... | |
29 | 25 | #define nmeter_trivial_usage \ |
30 | 26 | "format_string" |
31 | 27 | #define nmeter_full_usage "\n\n" \ |
32 | | diff --git a/networking/Config.src b/networking/Config.src |
33 | | index 6dd7df7..4682dd3 100644 |
34 | 28 | --- a/networking/Config.src |
35 | 29 | +++ b/networking/Config.src |
36 | 30 | @@ -640,6 +640,12 @@ config FEATURE_NAMEIF_EXTENDED |
... | ... | |
46 | 40 | config NETSTAT |
47 | 41 | bool "netstat" |
48 | 42 | default y |
49 | | diff --git a/networking/Kbuild.src b/networking/Kbuild.src |
50 | | index f41a2df..6070a40 100644 |
51 | 43 | --- a/networking/Kbuild.src |
52 | 44 | +++ b/networking/Kbuild.src |
53 | 45 | @@ -27,6 +27,7 @@ lib-$(CONFIG_IP) += ip.o |
... | ... | |
58 | 50 | lib-$(CONFIG_NETSTAT) += netstat.o |
59 | 51 | lib-$(CONFIG_NSLOOKUP) += nslookup.o |
60 | 52 | lib-$(CONFIG_NTPD) += ntpd.o |
61 | | diff --git a/networking/netmsg.c b/networking/netmsg.c |
62 | | new file mode 100644 |
63 | | index 0000000..43aba0d |
64 | 53 | --- /dev/null |
65 | 54 | +++ b/networking/netmsg.c |
66 | 55 | @@ -0,0 +1,63 @@ |
package/busybox/patches/340-lock_util.patch |
1 | 1 | --- a/include/applets.src.h |
2 | 2 | +++ b/include/applets.src.h |
3 | | @@ -229,6 +229,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN, |
| 3 | @@ -213,6 +213,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN, |
4 | 4 | IF_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) |
5 | 5 | IF_LOADFONT(APPLET(loadfont, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) |
6 | 6 | IF_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_DROP)) |
... | ... | |
10 | 10 | IF_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_DROP, logname)) |
11 | 11 | --- a/include/usage.src.h |
12 | 12 | +++ b/include/usage.src.h |
13 | | @@ -2320,6 +2320,9 @@ INSERT |
| 13 | @@ -2089,6 +2089,9 @@ INSERT |
14 | 14 | #define loadkmap_example_usage \ |
15 | 15 | "$ loadkmap < /etc/i18n/lang-keymap\n" |
16 | 16 | |
... | ... | |
22 | 22 | #define logger_full_usage "\n\n" \ |
23 | 23 | --- a/miscutils/Config.src |
24 | 24 | +++ b/miscutils/Config.src |
25 | | @@ -465,6 +465,11 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA |
| 25 | @@ -485,6 +485,11 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA |
26 | 26 | help |
27 | 27 | Enables the 'hdparm -d' option to get/set using_dma flag. |
28 | 28 | |
package/busybox/patches/350-httpd_redir.patch |
1 | 1 | --- a/include/usage.src.h |
2 | 2 | +++ b/include/usage.src.h |
3 | | @@ -1719,7 +1719,8 @@ INSERT |
| 3 | @@ -1623,7 +1623,8 @@ INSERT |
4 | 4 | IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") \ |
5 | 5 | IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") \ |
6 | 6 | " [-h HOME]\n" \ |
... | ... | |
10 | 10 | #define httpd_full_usage "\n\n" \ |
11 | 11 | "Listen for incoming HTTP requests\n" \ |
12 | 12 | "\nOptions:" \ |
13 | | @@ -1737,6 +1738,8 @@ INSERT |
| 13 | @@ -1641,6 +1642,8 @@ INSERT |
14 | 14 | "\n -m STRING MD5 crypt STRING") \ |
15 | 15 | "\n -e STRING HTML encode STRING" \ |
16 | 16 | "\n -d STRING URL decode STRING" \ |
... | ... | |
21 | 21 | IF_FEATURE_HWCLOCK_LONG_OPTIONS( \ |
22 | 22 | --- a/networking/httpd.c |
23 | 23 | +++ b/networking/httpd.c |
24 | | @@ -250,6 +250,8 @@ struct globals { |
| 24 | @@ -243,6 +243,8 @@ struct globals { |
25 | 25 | |
26 | 26 | const char *found_mime_type; |
27 | 27 | const char *found_moved_temporarily; |
... | ... | |
30 | 30 | Htaccess_IP *ip_a_d; /* config allow/deny lines */ |
31 | 31 | |
32 | 32 | IF_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;) |
33 | | @@ -296,6 +298,8 @@ struct globals { |
| 33 | @@ -293,6 +295,8 @@ struct globals { |
34 | 34 | #define index_page (G.index_page ) |
35 | 35 | #define found_mime_type (G.found_mime_type ) |
36 | 36 | #define found_moved_temporarily (G.found_moved_temporarily) |
... | ... | |
39 | 39 | #define last_mod (G.last_mod ) |
40 | 40 | #define ip_a_d (G.ip_a_d ) |
41 | 41 | #define g_realm (G.g_realm ) |
42 | | @@ -997,8 +1001,11 @@ static void send_headers(int responseNum |
| 42 | @@ -999,8 +1003,11 @@ static void send_headers(int responseNum |
43 | 43 | } |
44 | 44 | #endif |
45 | 45 | if (responseNum == HTTP_MOVED_TEMPORARILY) { |
... | ... | |
52 | 52 | (g_query ? "?" : ""), |
53 | 53 | (g_query ? g_query : "")); |
54 | 54 | } |
55 | | @@ -1942,8 +1949,12 @@ static void handle_incoming_and_exit(con |
| 55 | @@ -1967,8 +1974,12 @@ static void handle_incoming_and_exit(con |
56 | 56 | } while (*++tptr); |
57 | 57 | *++urlp = '\0'; /* terminate after last character */ |
58 | 58 | |
... | ... | |
66 | 66 | if (is_directory(urlcopy + 1, 1, NULL)) { |
67 | 67 | found_moved_temporarily = urlcopy; |
68 | 68 | } |
69 | | @@ -2283,7 +2294,9 @@ static void sighup_handler(int sig UNUSE |
| 69 | @@ -2325,7 +2336,9 @@ static void sighup_handler(int sig UNUSE |
70 | 70 | } |
71 | 71 | |
72 | 72 | enum { |
... | ... | |
77 | 77 | d_opt_decode_url, |
78 | 78 | h_opt_home_httpd, |
79 | 79 | IF_FEATURE_HTTPD_ENCODE_URL_STR(e_opt_encode_url,) |
80 | | @@ -2332,12 +2345,13 @@ int httpd_main(int argc UNUSED_PARAM, ch |
| 80 | @@ -2374,12 +2387,13 @@ int httpd_main(int argc UNUSED_PARAM, ch |
81 | 81 | /* We do not "absolutize" path given by -h (home) opt. |
82 | 82 | * If user gives relative path in -h, |
83 | 83 | * $SCRIPT_FILENAME will not be set. */ |
package/busybox/patches/470-insmod_search.patch |
1 | 1 | --- a/modutils/insmod.c |
2 | 2 | +++ b/modutils/insmod.c |
3 | | @@ -9,6 +9,99 @@ |
| 3 | @@ -11,6 +11,99 @@ |
4 | 4 | |
5 | 5 | #include "libbb.h" |
6 | 6 | #include "modutils.h" |
... | ... | |
100 | 100 | |
101 | 101 | /* 2.6 style insmod has no options and required filename |
102 | 102 | * (not module name - .ko can't be omitted) */ |
103 | | @@ -55,9 +148,15 @@ int insmod_main(int argc UNUSED_PARAM, c |
| 103 | @@ -59,9 +152,15 @@ int insmod_main(int argc UNUSED_PARAM, c |
104 | 104 | if (!filename) |
105 | 105 | bb_show_usage(); |
106 | 106 | |
... | ... | |
119 | 119 | } |
120 | 120 | --- a/modutils/Config.src |
121 | 121 | +++ b/modutils/Config.src |
122 | | @@ -228,7 +228,7 @@ config FEATURE_MODUTILS_SYMBOLS |
| 122 | @@ -229,7 +229,7 @@ config FEATURE_MODUTILS_SYMBOLS |
123 | 123 | config DEFAULT_MODULES_DIR |
124 | 124 | string "Default directory containing modules" |
125 | 125 | default "/lib/modules" |
package/busybox/patches/510-awk_include.patch |
5 | 5 | /* vi: set sw=4 ts=4: */ |
6 | 6 | /* |
7 | 7 | * awk implementation for busybox |
8 | | @@ -70,9 +71,14 @@ typedef struct chain_s { |
| 8 | @@ -74,9 +75,14 @@ typedef struct chain_s { |
9 | 9 | } chain; |
10 | 10 | |
11 | 11 | /* Function */ |
... | ... | |
20 | 20 | } func; |
21 | 21 | |
22 | 22 | /* I/O stream */ |
23 | | @@ -1453,7 +1459,8 @@ static void parse_program(char *p) |
| 23 | @@ -1466,7 +1472,8 @@ static void parse_program(char *p) |
24 | 24 | next_token(TC_FUNCTION); |
25 | 25 | g_pos++; |
26 | 26 | f = newfunc(t_string); |
... | ... | |
30 | 30 | f->nargs = 0; |
31 | 31 | while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) { |
32 | 32 | v = findvar(ahash, t_string); |
33 | | @@ -1462,7 +1469,7 @@ static void parse_program(char *p) |
| 33 | @@ -1475,7 +1482,7 @@ static void parse_program(char *p) |
34 | 34 | if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM) |
35 | 35 | break; |
36 | 36 | } |
... | ... | |
39 | 39 | chain_group(); |
40 | 40 | clear_array(ahash); |
41 | 41 | |
42 | | @@ -2547,7 +2554,8 @@ static var *evaluate(node *op, var *res) |
| 42 | @@ -2573,7 +2580,8 @@ static var *evaluate(node *op, var *res) |
43 | 43 | var *vbeg, *v; |
44 | 44 | const char *sv_progname; |
45 | 45 | |
... | ... | |
49 | 49 | syntax_error(EMSG_UNDEF_FUNC); |
50 | 50 | |
51 | 51 | vbeg = v = nvalloc(op->r.f->nargs + 1); |
52 | | @@ -2564,7 +2572,10 @@ static var *evaluate(node *op, var *res) |
| 52 | @@ -2590,7 +2598,10 @@ static var *evaluate(node *op, var *res) |
53 | 53 | fnargs = vbeg; |
54 | 54 | sv_progname = g_progname; |
55 | 55 | |
... | ... | |
61 | 61 | |
62 | 62 | g_progname = sv_progname; |
63 | 63 | nvfree(fnargs); |
64 | | @@ -2942,6 +2953,143 @@ static rstream *next_input_file(void) |
| 64 | @@ -2984,6 +2995,143 @@ static rstream *next_input_file(void) |
65 | 65 | #undef files_happen |
66 | 66 | } |
67 | 67 | |
... | ... | |
205 | 205 | int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
206 | 206 | int awk_main(int argc, char **argv) |
207 | 207 | { |
208 | | @@ -3007,6 +3155,9 @@ int awk_main(int argc, char **argv) |
| 208 | @@ -3049,6 +3197,9 @@ int awk_main(int argc, char **argv) |
209 | 209 | *s1 = '='; |
210 | 210 | } |
211 | 211 | } |
package/busybox/patches/803-id_getgrouplist.patch |
5 | 5 | |
6 | 6 | --- a/coreutils/id.c |
7 | 7 | +++ b/coreutils/id.c |
8 | | @@ -17,10 +17,12 @@ |
| 8 | @@ -19,10 +19,12 @@ |
9 | 9 | |
10 | | #include "libbb.h" |
| 10 | /* This is a NOEXEC applet. Be very careful! */ |
11 | 11 | |
12 | 12 | +#define HAVE_GETGROUPLIST 1 |
13 | 13 | + |
... | ... | |
19 | 19 | #endif |
20 | 20 | #endif |
21 | 21 | #endif |
22 | | @@ -82,7 +84,11 @@ static int get_groups(const char *userna |
| 22 | @@ -84,7 +86,11 @@ static int get_groups(const char *userna |
23 | 23 | /* If the user is a member of more than |
24 | 24 | * *n groups, then -1 is returned. Otherwise >= 0. |
25 | 25 | * (and no defined way of detecting errors?!) */ |
... | ... | |
31 | 31 | /* I guess *n < 0 might indicate error. Anyway, |
32 | 32 | * malloc'ing -1 bytes won't be good, so: */ |
33 | 33 | //if (*n < 0) |
34 | | @@ -154,6 +160,7 @@ int id_main(int argc UNUSED_PARAM, char |
| 34 | @@ -156,6 +162,7 @@ int id_main(int argc UNUSED_PARAM, char |
35 | 35 | if (egid != rgid) |
36 | 36 | status |= print_group(egid, " "); |
37 | 37 | } |
... | ... | |
39 | 39 | /* We are supplying largish buffer, trying |
40 | 40 | * to not run get_groups() twice. That might be slow |
41 | 41 | * ("user database in remote SQL server" case) */ |
42 | | @@ -181,6 +188,7 @@ int id_main(int argc UNUSED_PARAM, char |
| 42 | @@ -183,6 +190,7 @@ int id_main(int argc UNUSED_PARAM, char |
43 | 43 | } |
44 | 44 | if (ENABLE_FEATURE_CLEAN_UP) |
45 | 45 | free(groups); |
package/busybox/patches/910-insmod-q-flag.patch |
1 | 1 | --- a/modutils/insmod.c |
2 | 2 | +++ b/modutils/insmod.c |
3 | | @@ -129,7 +129,7 @@ int insmod_main(int argc, char **argv) M |
| 3 | @@ -133,7 +133,7 @@ int insmod_main(int argc, char **argv) M |
4 | 4 | int insmod_main(int argc UNUSED_PARAM, char **argv) |
5 | 5 | { |
6 | 6 | char *filename; |
... | ... | |
9 | 9 | |
10 | 10 | /* Compat note: |
11 | 11 | * 2.6 style insmod has no options and required filename |
12 | | @@ -139,10 +139,8 @@ int insmod_main(int argc UNUSED_PARAM, c |
| 12 | @@ -143,10 +143,8 @@ int insmod_main(int argc UNUSED_PARAM, c |
13 | 13 | * or in $MODPATH. |
14 | 14 | */ |
15 | 15 | |
... | ... | |
22 | 22 | |
23 | 23 | filename = *++argv; |
24 | 24 | if (!filename) |
25 | | @@ -153,7 +151,7 @@ int insmod_main(int argc UNUSED_PARAM, c |
| 25 | @@ -157,7 +155,7 @@ int insmod_main(int argc UNUSED_PARAM, c |
26 | 26 | goto done; |
27 | 27 | |
28 | 28 | rc = bb_init_module(g_filename, parse_cmdline_module_options(argv)); |