Deleted Added
full compact
udp_usrreq.c (72650) udp_usrreq.c (72778)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 72650 2001-02-18 13:30:20Z green $
34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 72778 2001-02-20 23:25:04Z jesper $
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

506 register struct ip *ip = vip;
507 register struct udphdr *uh;
508
509 if (!PRC_IS_REDIRECT(cmd) &&
510 ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
511 return;
512 if (ip) {
513 uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

506 register struct ip *ip = vip;
507 register struct udphdr *uh;
508
509 if (!PRC_IS_REDIRECT(cmd) &&
510 ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0))
511 return;
512 if (ip) {
513 uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
514 /*
515 * Only call in_pcbnotify if the src port number != 0, as we
516 * treat 0 as a wildcard in src/sys/in_pbc.c:in_pcbnotify()
517 *
518 * It's sufficient to check for src|local port, as we'll have no
519 * sessions with src|local port == 0
520 *
521 * Without this a attacker sending ICMP messages, where the attached
522 * IP header (+ 8 bytes) has the address and port numbers == 0, would
523 * have the ICMP message applied to all sessions.
524 */
525 if (uh->uh_sport == 0)
526 return;
514 in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
515 cmd, udp_notify, 0, 0);
516 } else
517 in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify, 0, 0);
518}
519
520static int
521udp_pcblist(SYSCTL_HANDLER_ARGS)

--- 392 unchanged lines hidden ---
527 in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
528 cmd, udp_notify, 0, 0);
529 } else
530 in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify, 0, 0);
531}
532
533static int
534udp_pcblist(SYSCTL_HANDLER_ARGS)

--- 392 unchanged lines hidden ---