mld6.c (254523) | mld6.c (254804) |
---|---|
1/*- 2 * Copyright (c) 2009 Bruce Simpson. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 50 unchanged lines hidden (view full) --- 59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 61 * SUCH DAMAGE. 62 * 63 * @(#)igmp.c 8.1 (Berkeley) 7/19/93 64 */ 65 66#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009 Bruce Simpson. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 50 unchanged lines hidden (view full) --- 59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 61 * SUCH DAMAGE. 62 * 63 * @(#)igmp.c 8.1 (Berkeley) 7/19/93 64 */ 65 66#include <sys/cdefs.h> |
67__FBSDID("$FreeBSD: head/sys/netinet6/mld6.c 254523 2013-08-19 13:27:32Z andre $"); | 67__FBSDID("$FreeBSD: head/sys/netinet6/mld6.c 254804 2013-08-24 19:51:18Z andre $"); |
68 69#include "opt_inet.h" 70#include "opt_inet6.h" 71 72#include <sys/param.h> 73#include <sys/systm.h> 74#include <sys/mbuf.h> 75#include <sys/socket.h> --- 194 unchanged lines hidden (view full) --- 270}; 271static struct ip6_pktopts mld_po; 272 273static __inline void 274mld_save_context(struct mbuf *m, struct ifnet *ifp) 275{ 276 277#ifdef VIMAGE | 68 69#include "opt_inet.h" 70#include "opt_inet6.h" 71 72#include <sys/param.h> 73#include <sys/systm.h> 74#include <sys/mbuf.h> 75#include <sys/socket.h> --- 194 unchanged lines hidden (view full) --- 270}; 271static struct ip6_pktopts mld_po; 272 273static __inline void 274mld_save_context(struct mbuf *m, struct ifnet *ifp) 275{ 276 277#ifdef VIMAGE |
278 m->m_pkthdr.header = ifp->if_vnet; | 278 m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; |
279#endif /* VIMAGE */ 280 m->m_pkthdr.flowid = ifp->if_index; 281} 282 283static __inline void 284mld_scrub_context(struct mbuf *m) 285{ 286 | 279#endif /* VIMAGE */ 280 m->m_pkthdr.flowid = ifp->if_index; 281} 282 283static __inline void 284mld_scrub_context(struct mbuf *m) 285{ 286 |
287 m->m_pkthdr.header = NULL; | 287 m->m_pkthdr.PH_loc.ptr = NULL; |
288 m->m_pkthdr.flowid = 0; 289} 290 291/* 292 * Restore context from a queued output chain. 293 * Return saved ifindex. 294 * 295 * VIMAGE: The assertion is there to make sure that we 296 * actually called CURVNET_SET() with what's in the mbuf chain. 297 */ 298static __inline uint32_t 299mld_restore_context(struct mbuf *m) 300{ 301 302#if defined(VIMAGE) && defined(INVARIANTS) | 288 m->m_pkthdr.flowid = 0; 289} 290 291/* 292 * Restore context from a queued output chain. 293 * Return saved ifindex. 294 * 295 * VIMAGE: The assertion is there to make sure that we 296 * actually called CURVNET_SET() with what's in the mbuf chain. 297 */ 298static __inline uint32_t 299mld_restore_context(struct mbuf *m) 300{ 301 302#if defined(VIMAGE) && defined(INVARIANTS) |
303 KASSERT(curvnet == m->m_pkthdr.header, | 303 KASSERT(curvnet == m->m_pkthdr.PH_loc.ptr, |
304 ("%s: called when curvnet was not restored", __func__)); 305#endif 306 return (m->m_pkthdr.flowid); 307} 308 309/* 310 * Retrieve or set threshold between group-source queries in seconds. 311 * --- 3003 unchanged lines hidden --- | 304 ("%s: called when curvnet was not restored", __func__)); 305#endif 306 return (m->m_pkthdr.flowid); 307} 308 309/* 310 * Retrieve or set threshold between group-source queries in seconds. 311 * --- 3003 unchanged lines hidden --- |