summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-31 03:36:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-31 03:36:02 +0000
commit9b8f810d38a720bca94af864e2960de91aae3a29 (patch)
tree10732e1683a0bd01ff263625e1a677b4c0974be2
parent9343da45d3f226cc8b45879ac8dbacac2911cdd8 (diff)
downloadbusybox-1_12_stable.tar.gz
Apply post 1.12.3 fixes, bump to 1.12.41_12_41_12_stable
-rw-r--r--Makefile2
-rw-r--r--coreutils/printf.c9
-rw-r--r--networking/ip.c2
-rw-r--r--networking/libiproute/iptunnel.c45
4 files changed, 53 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1bfb27082..195ce2a63 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 12
-SUBLEVEL = 3
+SUBLEVEL = 4
EXTRAVERSION =
NAME = Unnamed
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 76524f706..b0a48cda4 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -359,8 +359,15 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
* We will mimic coreutils. */
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
argv++;
- if (!argv[1])
+ if (!argv[1]) {
+ if (ENABLE_ASH_BUILTIN_PRINTF
+ && applet_name[0] != 'p'
+ ) {
+ bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
+ return 2; /* bash compat */
+ }
bb_show_usage();
+ }
format = argv[1];
argv2 = argv + 2;
diff --git a/networking/ip.c b/networking/ip.c
index 7dcddfd8c..fa6027893 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -31,7 +31,7 @@ static int NORETURN ip_print_help(char **argv UNUSED_PARAM)
static int ip_do(int (*ip_func)(char **argv), char **argv)
{
- argv = ip_parse_common_args(argv);
+ argv = ip_parse_common_args(argv + 1);
return ip_func(argv);
}
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 752d81264..5aa0c7d03 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -6,7 +6,6 @@
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
- *
* Changes:
*
* Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
@@ -18,10 +17,52 @@
#include <net/if.h>
#include <net/if_arp.h>
#include <asm/types.h>
+
#ifndef __constant_htons
#define __constant_htons htons
#endif
-#include <linux/if_tunnel.h>
+
+// FYI: #define SIOCDEVPRIVATE 0x89F0
+
+/* From linux/if_tunnel.h. #including it proved troublesome
+ * (redefiniton errors due to name collisions in linux/ and net[inet]/) */
+#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
+#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
+#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
+#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
+//#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
+//#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
+//#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
+//#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
+#define GRE_CSUM __constant_htons(0x8000)
+//#define GRE_ROUTING __constant_htons(0x4000)
+#define GRE_KEY __constant_htons(0x2000)
+#define GRE_SEQ __constant_htons(0x1000)
+//#define GRE_STRICT __constant_htons(0x0800)
+//#define GRE_REC __constant_htons(0x0700)
+//#define GRE_FLAGS __constant_htons(0x00F8)
+//#define GRE_VERSION __constant_htons(0x0007)
+struct ip_tunnel_parm {
+ char name[IFNAMSIZ];
+ int link;
+ uint16_t i_flags;
+ uint16_t o_flags;
+ uint32_t i_key;
+ uint32_t o_key;
+ struct iphdr iph;
+};
+/* SIT-mode i_flags */
+//#define SIT_ISATAP 0x0001
+//struct ip_tunnel_prl {
+// uint32_t addr;
+// uint16_t flags;
+// uint16_t __reserved;
+// uint32_t datalen;
+// uint32_t __reserved2;
+// /* data follows */
+//};
+///* PRL flags */
+//#define PRL_DEFAULT 0x0001
#include "ip_common.h" /* #include "libbb.h" is inside */
#include "rt_names.h"