Deleted Added
full compact
ftp.c (217505) ftp.c (221822)
1/*-
2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libfetch/ftp.c 217505 2011-01-17 17:25:46Z des $");
30__FBSDID("$FreeBSD: head/lib/libfetch/ftp.c 221822 2011-05-12 21:26:42Z des $");
31
32/*
33 * Portions of this code were taken from or based on ftpio.c:
34 *
35 * ----------------------------------------------------------------------------
36 * "THE BEER-WARE LICENSE" (Revision 42):
37 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
38 * can do whatever you want with this stuff. If we meet some day, and you think

--- 83 unchanged lines hidden (view full) ---

122 struct sockaddr_in *sin4;
123 u_int32_t addr;
124 int port;
125
126 if (sin6->sin6_family != AF_INET6 ||
127 !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
128 return;
129 sin4 = (struct sockaddr_in *)sin6;
31
32/*
33 * Portions of this code were taken from or based on ftpio.c:
34 *
35 * ----------------------------------------------------------------------------
36 * "THE BEER-WARE LICENSE" (Revision 42):
37 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
38 * can do whatever you want with this stuff. If we meet some day, and you think

--- 83 unchanged lines hidden (view full) ---

122 struct sockaddr_in *sin4;
123 u_int32_t addr;
124 int port;
125
126 if (sin6->sin6_family != AF_INET6 ||
127 !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
128 return;
129 sin4 = (struct sockaddr_in *)sin6;
130 addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
130 addr = *(u_int32_t *)(uintptr_t)&sin6->sin6_addr.s6_addr[12];
131 port = sin6->sin6_port;
132 memset(sin4, 0, sizeof(struct sockaddr_in));
133 sin4->sin_addr.s_addr = addr;
134 sin4->sin_port = port;
135 sin4->sin_family = AF_INET;
136 sin4->sin_len = sizeof(struct sockaddr_in);
137}
138

--- 1069 unchanged lines hidden ---
131 port = sin6->sin6_port;
132 memset(sin4, 0, sizeof(struct sockaddr_in));
133 sin4->sin_addr.s_addr = addr;
134 sin4->sin_port = port;
135 sin4->sin_family = AF_INET;
136 sin4->sin_len = sizeof(struct sockaddr_in);
137}
138

--- 1069 unchanged lines hidden ---