Deleted Added
full compact
ndiscvt.c (178213) ndiscvt.c (201387)
1/*
2 * Copyright (c) 2003
3 * Bill Paul <wpaul@windriver.com>. 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

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2003
3 * Bill Paul <wpaul@windriver.com>. 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

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/usr.sbin/ndiscvt/ndiscvt.c 178213 2008-04-15 04:17:13Z thompsa $");
34__FBSDID("$FreeBSD: head/usr.sbin/ndiscvt/ndiscvt.c 201387 2010-01-02 11:05:34Z ed $");
35
36#include <sys/types.h>
37#include <sys/queue.h>
38#include <sys/socket.h>
39#include <net/if.h>
40#include <stdlib.h>
41#include <stddef.h>
42#include <unistd.h>

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

86#define ROUND_UP(n, align) ROUND_DOWN(((uintptr_t)n) + (align) - 1l, \
87 (align))
88
89#define SET_HDRS(x) \
90 dos_hdr = (image_dos_header *)x; \
91 nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew); \
92 sect_hdr = IMAGE_FIRST_SECTION(nt_hdr);
93
35
36#include <sys/types.h>
37#include <sys/queue.h>
38#include <sys/socket.h>
39#include <net/if.h>
40#include <stdlib.h>
41#include <stddef.h>
42#include <unistd.h>

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

86#define ROUND_UP(n, align) ROUND_DOWN(((uintptr_t)n) + (align) - 1l, \
87 (align))
88
89#define SET_HDRS(x) \
90 dos_hdr = (image_dos_header *)x; \
91 nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew); \
92 sect_hdr = IMAGE_FIRST_SECTION(nt_hdr);
93
94static
95int insert_padding(imgbase, imglen)
96 void **imgbase;
97 int *imglen;
94static int
95insert_padding(void **imgbase, int *imglen)
98{
99 image_section_header *sect_hdr;
100 image_dos_header *dos_hdr;
101 image_nt_header *nt_hdr;
102 image_optional_header opt_hdr;
103 int i = 0, sections, curlen = 0;
104 int offaccum = 0, oldraddr, oldrlen;
105 uint8_t *newimg, *tmp;

--- 327 unchanged lines hidden ---
96{
97 image_section_header *sect_hdr;
98 image_dos_header *dos_hdr;
99 image_nt_header *nt_hdr;
100 image_optional_header opt_hdr;
101 int i = 0, sections, curlen = 0;
102 int offaccum = 0, oldraddr, oldrlen;
103 uint8_t *newimg, *tmp;

--- 327 unchanged lines hidden ---