mirror of https://github.com/hak5/openwrt.git
busybox: add 6RD prefix sanity checking as mandated by RFC5969, bump pkg revision
SVN-Revision: 23990lede-17.01
parent
9efe60a464
commit
e3f13f0141
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=busybox
|
PKG_NAME:=busybox
|
||||||
PKG_VERSION:=1.17.3
|
PKG_VERSION:=1.17.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_FLAGS:=essential
|
PKG_FLAGS:=essential
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
/* really simple implementation, just count the bits */
|
/* really simple implementation, just count the bits */
|
||||||
static int mton(uint32_t mask)
|
static int mton(uint32_t mask)
|
||||||
{
|
{
|
||||||
@@ -177,6 +195,60 @@ static NOINLINE char *xmalloc_optname_op
|
@@ -177,6 +195,70 @@ static NOINLINE char *xmalloc_optname_op
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,15 @@
|
||||||
+ * We convert it to a string "IPv4MaskLen 6rdPrefixLen 6rdPrefix 6rdBRIPv4Address"
|
+ * We convert it to a string "IPv4MaskLen 6rdPrefixLen 6rdPrefix 6rdBRIPv4Address"
|
||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
|
+ /* Sanity check: ensure that our length is at least 22 bytes, that
|
||||||
|
+ * IPv4MaskLen is <= 32, 6rdPrefixLen <= 128 and that the sum of
|
||||||
|
+ * (32 - IPv4MaskLen) + 6rdPrefixLen is less than or equal to 128.
|
||||||
|
+ * If any of these requirements is not fulfilled, return with empty
|
||||||
|
+ * value.
|
||||||
|
+ */
|
||||||
|
+ if ((len >= 22) && (*option <= 32) && (*(option+1) <= 128) &&
|
||||||
|
+ (((32 - *option) + *(option+1)) <= 128))
|
||||||
|
+ {
|
||||||
+ /* IPv4MaskLen */
|
+ /* IPv4MaskLen */
|
||||||
+ dest += sprintf(dest, "%u ", *option++);
|
+ dest += sprintf(dest, "%u ", *option++);
|
||||||
+ len--;
|
+ len--;
|
||||||
|
@ -113,6 +122,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in New Issue