Deleted Added
full compact
ip_output.c (129126) ip_output.c (130416)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 * $FreeBSD: head/sys/netinet/ip_output.c 129126 2004-05-11 19:14:44Z maxim $
30 * $FreeBSD: head/sys/netinet/ip_output.c 130416 2004-06-13 17:29:10Z mlaier $
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipdn.h"
35#include "opt_ipdivert.h"
36#include "opt_ipfilter.h"
37#include "opt_ipsec.h"
38#include "opt_mac.h"

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

399 if (ip->ip_src.s_addr == INADDR_ANY) {
400 /* Interface may have no addresses. */
401 if (ia != NULL) {
402 ip->ip_src = IA_SIN(ia)->sin_addr;
403 src_was_INADDR_ANY = 1;
404 }
405 }
406#endif /* notdef */
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipdn.h"
35#include "opt_ipdivert.h"
36#include "opt_ipfilter.h"
37#include "opt_ipsec.h"
38#include "opt_mac.h"

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

399 if (ip->ip_src.s_addr == INADDR_ANY) {
400 /* Interface may have no addresses. */
401 if (ia != NULL) {
402 ip->ip_src = IA_SIN(ia)->sin_addr;
403 src_was_INADDR_ANY = 1;
404 }
405 }
406#endif /* notdef */
407#ifdef ALTQ
407 /*
408 /*
409 * disable packet drop hack.
410 * packetdrop should be done by queueing.
411 */
412#else /* !ALTQ */
413 /*
408 * Verify that we have any chance at all of being able to queue
409 * the packet or packet fragments
410 */
411 if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
412 ifp->if_snd.ifq_maxlen) {
413 error = ENOBUFS;
414 ipstat.ips_odropped++;
415 goto bad;
416 }
414 * Verify that we have any chance at all of being able to queue
415 * the packet or packet fragments
416 */
417 if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
418 ifp->if_snd.ifq_maxlen) {
419 error = ENOBUFS;
420 ipstat.ips_odropped++;
421 goto bad;
422 }
423#endif /* !ALTQ */
417
418 /*
419 * Look for broadcast address and
420 * verify user is allowed to send
421 * such a packet.
422 */
423 if (isbroadcast) {
424 if ((ifp->if_flags & IFF_BROADCAST) == 0) {

--- 1806 unchanged lines hidden ---
424
425 /*
426 * Look for broadcast address and
427 * verify user is allowed to send
428 * such a packet.
429 */
430 if (isbroadcast) {
431 if ((ifp->if_flags & IFF_BROADCAST) == 0) {

--- 1806 unchanged lines hidden ---