Deleted Added
full compact
bootp_subr.c (108470) bootp_subr.c (109623)
1/*
2 * Copyright (c) 1995 Gordon Ross, Adam Glass
3 * Copyright (c) 1992 Regents of the University of California.
4 * All rights reserved.
5 *
6 * This software was developed by the Computer Systems Engineering group
7 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
8 * contributed to Berkeley.

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

36 * SUCH DAMAGE.
37 *
38 * based on:
39 * nfs/krpc_subr.c
40 * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
41 */
42
43#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1995 Gordon Ross, Adam Glass
3 * Copyright (c) 1992 Regents of the University of California.
4 * All rights reserved.
5 *
6 * This software was developed by the Computer Systems Engineering group
7 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
8 * contributed to Berkeley.

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

36 * SUCH DAMAGE.
37 *
38 * based on:
39 * nfs/krpc_subr.c
40 * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/nfsclient/bootp_subr.c 108470 2002-12-30 21:18:15Z schweikh $");
44__FBSDID("$FreeBSD: head/sys/nfsclient/bootp_subr.c 109623 2003-01-21 08:56:16Z alfred $");
45
46#include "opt_bootp.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/kernel.h>
51#include <sys/sockio.h>
52#include <sys/malloc.h>

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

428 sin->sin_port = 0;
429}
430
431static struct bootpc_ifcontext *
432allocifctx(struct bootpc_globalcontext *gctx)
433{
434 struct bootpc_ifcontext *ifctx;
435 ifctx = (struct bootpc_ifcontext *) malloc(sizeof(*ifctx),
45
46#include "opt_bootp.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/kernel.h>
51#include <sys/sockio.h>
52#include <sys/malloc.h>

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

428 sin->sin_port = 0;
429}
430
431static struct bootpc_ifcontext *
432allocifctx(struct bootpc_globalcontext *gctx)
433{
434 struct bootpc_ifcontext *ifctx;
435 ifctx = (struct bootpc_ifcontext *) malloc(sizeof(*ifctx),
436 M_TEMP, M_WAITOK);
436 M_TEMP, 0);
437 if (ifctx == NULL)
438 panic("Failed to allocate bootp interface context structure");
439
440 bzero(ifctx, sizeof(*ifctx));
441 ifctx->xid = gctx->xid;
442#ifdef BOOTP_NO_DHCP
443 ifctx->state = IF_BOOTP_UNRESOLVED;
444#else

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

1670 td = curthread;
1671
1672 /*
1673 * If already filled in, don't touch it here
1674 */
1675 if (nfs_diskless_valid != 0)
1676 return;
1677
437 if (ifctx == NULL)
438 panic("Failed to allocate bootp interface context structure");
439
440 bzero(ifctx, sizeof(*ifctx));
441 ifctx->xid = gctx->xid;
442#ifdef BOOTP_NO_DHCP
443 ifctx->state = IF_BOOTP_UNRESOLVED;
444#else

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

1670 td = curthread;
1671
1672 /*
1673 * If already filled in, don't touch it here
1674 */
1675 if (nfs_diskless_valid != 0)
1676 return;
1677
1678 gctx = malloc(sizeof(*gctx), M_TEMP, M_WAITOK);
1678 gctx = malloc(sizeof(*gctx), M_TEMP, 0);
1679 if (gctx == NULL)
1680 panic("Failed to allocate bootp global context structure");
1681
1682 bzero(gctx, sizeof(*gctx));
1683 gctx->xid = ~0xFFFF;
1684 gctx->starttime = time_second;
1685
1686 ifctx = allocifctx(gctx);

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

1937 int size = -1;
1938 int attribs_present;
1939 int status;
1940 union {
1941 u_int32_t v2[17];
1942 u_int32_t v3[21];
1943 } fattribs;
1944
1679 if (gctx == NULL)
1680 panic("Failed to allocate bootp global context structure");
1681
1682 bzero(gctx, sizeof(*gctx));
1683 gctx->xid = ~0xFFFF;
1684 gctx->starttime = time_second;
1685
1686 ifctx = allocifctx(gctx);

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

1937 int size = -1;
1938 int attribs_present;
1939 int status;
1940 union {
1941 u_int32_t v2[17];
1942 u_int32_t v3[21];
1943 } fattribs;
1944
1945 m = m_get(M_TRYWAIT, MT_DATA);
1945 m = m_get(0, MT_DATA);
1946 if (m == NULL)
1947 return ENOBUFS;
1948
1949 if ((args->flags & NFSMNT_NFSV3) != 0) {
1950 *mtod(m, u_int32_t *) = txdr_unsigned(*fhsizep);
1951 bcopy(fhp, mtod(m, u_char *) + sizeof(u_int32_t), *fhsizep);
1952 m->m_len = *fhsizep + sizeof(u_int32_t);
1953 } else {

--- 69 unchanged lines hidden ---
1946 if (m == NULL)
1947 return ENOBUFS;
1948
1949 if ((args->flags & NFSMNT_NFSV3) != 0) {
1950 *mtod(m, u_int32_t *) = txdr_unsigned(*fhsizep);
1951 bcopy(fhp, mtod(m, u_char *) + sizeof(u_int32_t), *fhsizep);
1952 m->m_len = *fhsizep + sizeof(u_int32_t);
1953 } else {

--- 69 unchanged lines hidden ---