if_bridge.c (201122) | if_bridge.c (201527) |
---|---|
1/* $NetBSD: if_bridge.c,v 1.31 2005/06/01 19:45:34 jdc Exp $ */ 2 3/* 4 * Copyright 2001 Wasabi Systems, Inc. 5 * All rights reserved. 6 * 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 8 * --- 61 unchanged lines hidden (view full) --- 70 * 71 * - Currently only supports Ethernet-like interfaces (Ethernet, 72 * 802.11, VLANs on Ethernet, etc.) Figure out a nice way 73 * to bridge other types of interfaces (FDDI-FDDI, and maybe 74 * consider heterogenous bridges). 75 */ 76 77#include <sys/cdefs.h> | 1/* $NetBSD: if_bridge.c,v 1.31 2005/06/01 19:45:34 jdc Exp $ */ 2 3/* 4 * Copyright 2001 Wasabi Systems, Inc. 5 * All rights reserved. 6 * 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 8 * --- 61 unchanged lines hidden (view full) --- 70 * 71 * - Currently only supports Ethernet-like interfaces (Ethernet, 72 * 802.11, VLANs on Ethernet, etc.) Figure out a nice way 73 * to bridge other types of interfaces (FDDI-FDDI, and maybe 74 * consider heterogenous bridges). 75 */ 76 77#include <sys/cdefs.h> |
78__FBSDID("$FreeBSD: head/sys/net/if_bridge.c 201122 2009-12-28 10:47:04Z luigi $"); | 78__FBSDID("$FreeBSD: head/sys/net/if_bridge.c 201527 2010-01-04 19:01:22Z luigi $"); |
79 80#include "opt_inet.h" 81#include "opt_inet6.h" 82#include "opt_carp.h" 83 84#include <sys/param.h> 85#include <sys/mbuf.h> 86#include <sys/malloc.h> --- 2948 unchanged lines hidden (view full) --- 3035 default: 3036 error = 0; 3037 } 3038 if (error) 3039 goto bad; 3040 } 3041 3042 /* XXX this section is also in if_ethersubr.c */ | 79 80#include "opt_inet.h" 81#include "opt_inet6.h" 82#include "opt_carp.h" 83 84#include <sys/param.h> 85#include <sys/mbuf.h> 86#include <sys/malloc.h> --- 2948 unchanged lines hidden (view full) --- 3035 default: 3036 error = 0; 3037 } 3038 if (error) 3039 goto bad; 3040 } 3041 3042 /* XXX this section is also in if_ethersubr.c */ |
3043 if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { | 3043 // XXX PFIL_OUT or DIR_OUT ? 3044 if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && 3045 dir == PFIL_OUT && ifp != NULL) { |
3044 struct m_tag *mtag; 3045 3046 error = -1; | 3046 struct m_tag *mtag; 3047 3048 error = -1; |
3047 mtag = m_tag_find(*mp, PACKET_TAG_DUMMYNET, NULL); | 3049 /* fetch the start point from existing tags, if any */ 3050 mtag = m_tag_locate(*mp, MTAG_IPFW_RULE, 0, NULL); |
3048 if (mtag == NULL) { | 3051 if (mtag == NULL) { |
3049 args.slot = 0; | 3052 args.rule.slot = 0; |
3050 } else { 3051 struct dn_pkt_tag *dn_tag; 3052 | 3053 } else { 3054 struct dn_pkt_tag *dn_tag; 3055 |
3056 /* XXX can we free the tag after use ? */ |
|
3053 mtag->m_tag_id = PACKET_TAG_NONE; 3054 dn_tag = (struct dn_pkt_tag *)(mtag + 1); | 3057 mtag->m_tag_id = PACKET_TAG_NONE; 3058 dn_tag = (struct dn_pkt_tag *)(mtag + 1); |
3055 if (dn_tag->slot != 0 && V_fw_one_pass) 3056 /* packet already partially processed */ | 3059 /* packet already partially processed ? */ 3060 if (dn_tag->rule.slot != 0 && V_fw_one_pass) |
3057 goto ipfwpass; | 3061 goto ipfwpass; |
3058 args.slot = dn_tag->slot; /* next rule to use */ 3059 args.chain_id = dn_tag->chain_id; 3060 args.rulenum = dn_tag->rulenum; 3061 args.rule_id = dn_tag->rule_id; | 3062 args.rule = dn_tag->rule; |
3062 } 3063 3064 args.m = *mp; 3065 args.oif = ifp; 3066 args.next_hop = NULL; 3067 args.eh = &eh2; 3068 args.inp = NULL; /* used by ipfw uid/gid/jail rules */ 3069 i = V_ip_fw_chk_ptr(&args); --- 368 unchanged lines hidden --- | 3063 } 3064 3065 args.m = *mp; 3066 args.oif = ifp; 3067 args.next_hop = NULL; 3068 args.eh = &eh2; 3069 args.inp = NULL; /* used by ipfw uid/gid/jail rules */ 3070 i = V_ip_fw_chk_ptr(&args); --- 368 unchanged lines hidden --- |