Deleted Added
sdiff udiff text old ( 125226 ) new ( 127307 )
full compact
1/* $NetBSD: ip_gre.c,v 1.29 2003/09/05 23:02:43 itojun Exp $ */
2/* $FreeBSD: head/sys/netinet/ip_gre.c 125226 2004-01-30 09:03:01Z sobomax $ */
3
4/*
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *

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

309
310 m->m_pkthdr.rcvif = &sc->sc_if;
311
312 netisr_dispatch(NETISR_IP, m);
313}
314
315/*
316 * Find the gre interface associated with our src/dst/proto set.
317 */
318static struct gre_softc *
319gre_lookup(m, proto)
320 struct mbuf *m;
321 u_int8_t proto;
322{
323 struct ip *ip = mtod(m, struct ip *);
324 struct gre_softc *sc;
325
326 for (sc = LIST_FIRST(&gre_softc_list); sc != NULL;
327 sc = LIST_NEXT(sc, sc_list)) {
328 if ((sc->g_dst.s_addr == ip->ip_src.s_addr) &&
329 (sc->g_src.s_addr == ip->ip_dst.s_addr) &&
330 (sc->g_proto == proto) &&
331 ((sc->sc_if.if_flags & IFF_UP) != 0))
332 return (sc);
333 }
334
335 return (NULL);
336}