if_stf.c (109322) | if_stf.c (109623) |
---|---|
1/* $FreeBSD: head/sys/net/if_stf.c 109322 2003-01-15 20:09:52Z suz $ */ | 1/* $FreeBSD: head/sys/net/if_stf.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2/* $KAME: if_stf.c,v 1.73 2001/12/03 11:08:30 keiichi Exp $ */ 3 4/* 5 * Copyright (C) 2000 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 164 unchanged lines hidden (view full) --- 174 175int 176stf_clone_create(ifc, unit) 177 struct if_clone *ifc; 178 int unit; 179{ 180 struct stf_softc *sc; 181 | 2/* $KAME: if_stf.c,v 1.73 2001/12/03 11:08:30 keiichi Exp $ */ 3 4/* 5 * Copyright (C) 2000 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 164 unchanged lines hidden (view full) --- 174 175int 176stf_clone_create(ifc, unit) 177 struct if_clone *ifc; 178 int unit; 179{ 180 struct stf_softc *sc; 181 |
182 sc = malloc(sizeof(struct stf_softc), M_STF, M_WAITOK | M_ZERO); | 182 sc = malloc(sizeof(struct stf_softc), M_STF, M_ZERO); |
183 sc->sc_if.if_name = STFNAME; 184 sc->sc_if.if_unit = unit; 185 186 sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, 187 stf_encapcheck, &in_stf_protosw, sc); 188 if (sc->encap_cookie == NULL) { 189 printf("%s: attach failed\n", if_name(&sc->sc_if)); 190 free(sc, M_STF); --- 250 unchanged lines hidden (view full) --- 441#ifdef HAVE_OLD_BPF 442 BPF_MTAP(ifp, &m0); 443#else 444 bpf_mtap(ifp->if_bpf, &m0); 445#endif 446 } 447#endif /*NBPFILTER > 0*/ 448 | 183 sc->sc_if.if_name = STFNAME; 184 sc->sc_if.if_unit = unit; 185 186 sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, 187 stf_encapcheck, &in_stf_protosw, sc); 188 if (sc->encap_cookie == NULL) { 189 printf("%s: attach failed\n", if_name(&sc->sc_if)); 190 free(sc, M_STF); --- 250 unchanged lines hidden (view full) --- 441#ifdef HAVE_OLD_BPF 442 BPF_MTAP(ifp, &m0); 443#else 444 bpf_mtap(ifp->if_bpf, &m0); 445#endif 446 } 447#endif /*NBPFILTER > 0*/ 448 |
449 M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); | 449 M_PREPEND(m, sizeof(struct ip), M_NOWAIT); |
450 if (m && m->m_len < sizeof(struct ip)) 451 m = m_pullup(m, sizeof(struct ip)); 452 if (m == NULL) { 453 ifp->if_oerrors++; 454 return ENOBUFS; 455 } 456 ip = mtod(m, struct ip *); 457 --- 327 unchanged lines hidden --- | 450 if (m && m->m_len < sizeof(struct ip)) 451 m = m_pullup(m, sizeof(struct ip)); 452 if (m == NULL) { 453 ifp->if_oerrors++; 454 return ENOBUFS; 455 } 456 ip = mtod(m, struct ip *); 457 --- 327 unchanged lines hidden --- |