Deleted Added
full compact
mountd.c (216587) mountd.c (219125)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Herb Hasler and Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

38
39#if 0
40#ifndef lint
41static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
42#endif /*not lint*/
43#endif
44
45#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Herb Hasler and Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

38
39#if 0
40#ifndef lint
41static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
42#endif /*not lint*/
43#endif
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: head/usr.sbin/mountd/mountd.c 216587 2010-12-20 09:28:28Z charnier $");
46__FBSDID("$FreeBSD: head/usr.sbin/mountd/mountd.c 219125 2011-03-01 11:47:16Z ru $");
47
48#include <sys/param.h>
49#include <sys/fcntl.h>
50#include <sys/linker.h>
51#include <sys/module.h>
52#include <sys/mount.h>
53#include <sys/stat.h>
54#include <sys/sysctl.h>

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

2870
2871 if ((p = sa_rawaddr((struct sockaddr *)ssp, &len)) == NULL)
2872 return (-1);
2873 if (bitlen > len * CHAR_BIT)
2874 return (-1);
2875
2876 for (i = 0; i < len; i++) {
2877 bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
47
48#include <sys/param.h>
49#include <sys/fcntl.h>
50#include <sys/linker.h>
51#include <sys/module.h>
52#include <sys/mount.h>
53#include <sys/stat.h>
54#include <sys/sysctl.h>

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

2870
2871 if ((p = sa_rawaddr((struct sockaddr *)ssp, &len)) == NULL)
2872 return (-1);
2873 if (bitlen > len * CHAR_BIT)
2874 return (-1);
2875
2876 for (i = 0; i < len; i++) {
2877 bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
2878 *p++ = (1 << bits) - 1;
2878 *p++ = (u_char)~0 << (CHAR_BIT - bits);
2879 bitlen -= bits;
2880 }
2881 return 0;
2882}
2883
2884/*
2885 * Check that the sockaddr is a valid netmask. Returns 0 if the mask
2886 * is acceptable (i.e. of the form 1...10....0).

--- 106 unchanged lines hidden ---
2879 bitlen -= bits;
2880 }
2881 return 0;
2882}
2883
2884/*
2885 * Check that the sockaddr is a valid netmask. Returns 0 if the mask
2886 * is acceptable (i.e. of the form 1...10....0).

--- 106 unchanged lines hidden ---