summaryrefslogtreecommitdiff
path: root/edk2/StdLib/BsdSocketLib
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2012-10-12 11:46:51 +0100
committerRyan Harkin <ryan.harkin@linaro.org>2012-10-12 11:46:51 +0100
commitb60dc2d3e998a65b6d34bfd852838ea1149f19f9 (patch)
tree7393bc3f451803043afe8cc12fd78ecc4d1f1215 /edk2/StdLib/BsdSocketLib
parent25323acd0c4c5d7aba0125d031066e55333f214b (diff)
parent67154aa040304dd7b32471f32f3b0f2d4dfbb984 (diff)
Merge branch 'armlt-tracking' of git://git.linaro.org/arm/uefi/uefi-nextlinaro-uefi-2012.10
Diffstat (limited to 'edk2/StdLib/BsdSocketLib')
-rw-r--r--edk2/StdLib/BsdSocketLib/BsdSocketLib.inf5
-rw-r--r--edk2/StdLib/BsdSocketLib/Ip6Addr_Any.c18
-rw-r--r--edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllNodes.c18
-rw-r--r--edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllRouters.c18
-rw-r--r--edk2/StdLib/BsdSocketLib/Ip6Addr_Loopback.c18
-rw-r--r--edk2/StdLib/BsdSocketLib/Ip6Addr_NodeLocal_AllNodes.c18
-rw-r--r--edk2/StdLib/BsdSocketLib/ns_ntoa.c2
-rw-r--r--edk2/StdLib/BsdSocketLib/ns_parse.c44
8 files changed, 121 insertions, 20 deletions
diff --git a/edk2/StdLib/BsdSocketLib/BsdSocketLib.inf b/edk2/StdLib/BsdSocketLib/BsdSocketLib.inf
index d095e5337..df699b19d 100644
--- a/edk2/StdLib/BsdSocketLib/BsdSocketLib.inf
+++ b/edk2/StdLib/BsdSocketLib/BsdSocketLib.inf
@@ -57,6 +57,11 @@
inet_net_pton.c
inet_neta.c
inet_pton.c
+ Ip6Addr_Any.c
+ Ip6Addr_Loopback.c
+ Ip6Addr_NodeLocal_AllNodes.c
+ Ip6Addr_LinkLocal_AllNodes.c
+ Ip6Addr_LinkLocal_AllRouters.c
listen.c
map_v4v6.c
ns_addr.c
diff --git a/edk2/StdLib/BsdSocketLib/Ip6Addr_Any.c b/edk2/StdLib/BsdSocketLib/Ip6Addr_Any.c
new file mode 100644
index 000000000..b1bbe2610
--- /dev/null
+++ b/edk2/StdLib/BsdSocketLib/Ip6Addr_Any.c
@@ -0,0 +1,18 @@
+/** @file
+ IP6 address: any
+
+ Copyright (c) 2011, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <netinet/in.h>
+
+const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+
diff --git a/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllNodes.c b/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllNodes.c
new file mode 100644
index 000000000..358055de4
--- /dev/null
+++ b/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllNodes.c
@@ -0,0 +1,18 @@
+/** @file
+ IP6 address: link local, all nodes
+
+ Copyright (c) 2011, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <netinet/in.h>
+
+const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT;
+
diff --git a/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllRouters.c b/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllRouters.c
new file mode 100644
index 000000000..ca8b847ee
--- /dev/null
+++ b/edk2/StdLib/BsdSocketLib/Ip6Addr_LinkLocal_AllRouters.c
@@ -0,0 +1,18 @@
+/** @file
+ IP6 address: link local, all routers
+
+ Copyright (c) 2011, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <netinet/in.h>
+
+const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
+
diff --git a/edk2/StdLib/BsdSocketLib/Ip6Addr_Loopback.c b/edk2/StdLib/BsdSocketLib/Ip6Addr_Loopback.c
new file mode 100644
index 000000000..cc073f2e6
--- /dev/null
+++ b/edk2/StdLib/BsdSocketLib/Ip6Addr_Loopback.c
@@ -0,0 +1,18 @@
+/** @file
+ IP6 address: loopback
+
+ Copyright (c) 2011, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <netinet/in.h>
+
+const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
+
diff --git a/edk2/StdLib/BsdSocketLib/Ip6Addr_NodeLocal_AllNodes.c b/edk2/StdLib/BsdSocketLib/Ip6Addr_NodeLocal_AllNodes.c
new file mode 100644
index 000000000..b597e11f3
--- /dev/null
+++ b/edk2/StdLib/BsdSocketLib/Ip6Addr_NodeLocal_AllNodes.c
@@ -0,0 +1,18 @@
+/** @file
+ IP6 address: node local, all nodes
+
+ Copyright (c) 2011, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <netinet/in.h>
+
+const struct in6_addr in6addr_nodelocal_allnodes = IN6ADDR_NODELOCAL_ALLNODES_INIT;
+
diff --git a/edk2/StdLib/BsdSocketLib/ns_ntoa.c b/edk2/StdLib/BsdSocketLib/ns_ntoa.c
index d079dc866..5195d4ec9 100644
--- a/edk2/StdLib/BsdSocketLib/ns_ntoa.c
+++ b/edk2/StdLib/BsdSocketLib/ns_ntoa.c
@@ -55,7 +55,7 @@ ns_ntoa(
u_char *uplim = up + 6;
net.net_e = addr.x_net;
- sprintf(obuf, "%Lx", (u_long)ntohl(net.long_e));
+ sprintf(obuf, "%x", (UINT32)ntohl(net.long_e));
cp = spectHex(obuf);
cp2 = cp + 1;
while (*up==0 && up < uplim) up++;
diff --git a/edk2/StdLib/BsdSocketLib/ns_parse.c b/edk2/StdLib/BsdSocketLib/ns_parse.c
index 6909d4ef5..40ae79ea7 100644
--- a/edk2/StdLib/BsdSocketLib/ns_parse.c
+++ b/edk2/StdLib/BsdSocketLib/ns_parse.c
@@ -1,21 +1,13 @@
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
+/** @file
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-/*
* Portions copyright (c) 1999, 2000
* Intel Corporation.
* All rights reserved.
@@ -53,7 +45,21 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- */
+ * Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+**/
#include <sys/types.h>
@@ -160,7 +166,7 @@ ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
int b;
/* Make section right. */
- if (section < 0 || section >= ns_s_max)
+ if ((unsigned int)section >= ns_s_max)
goto enodev;
if ((int)section != (int)handle->_sect) {
handle->_sect = section;