aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_input.c20
-rw-r--r--net/bridge/br_private.h3
2 files changed, 11 insertions, 12 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index a260679afad8..2f5c379d9ffa 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -121,13 +121,11 @@ static inline int is_link_local(const unsigned char *dest)
121 121
122/* 122/*
123 * Called via br_handle_frame_hook. 123 * Called via br_handle_frame_hook.
124 * Return 0 if *pskb should be processed furthur 124 * Return NULL if skb is handled
125 * 1 if *pskb is handled
126 * note: already called with rcu_read_lock (preempt_disabled) 125 * note: already called with rcu_read_lock (preempt_disabled)
127 */ 126 */
128int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb) 127struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
129{ 128{
130 struct sk_buff *skb = *pskb;
131 const unsigned char *dest = eth_hdr(skb)->h_dest; 129 const unsigned char *dest = eth_hdr(skb)->h_dest;
132 130
133 if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) 131 if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
@@ -135,15 +133,15 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)
135 133
136 if (unlikely(is_link_local(dest))) { 134 if (unlikely(is_link_local(dest))) {
137 skb->pkt_type = PACKET_HOST; 135 skb->pkt_type = PACKET_HOST;
138 return NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, 136
139 NULL, br_handle_local_finish) != 0; 137 return (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
138 NULL, br_handle_local_finish) == 0) ? skb : NULL;
140 } 139 }
141 140
142 if (p->state == BR_STATE_FORWARDING || p->state == BR_STATE_LEARNING) { 141 if (p->state == BR_STATE_FORWARDING || p->state == BR_STATE_LEARNING) {
143 if (br_should_route_hook) { 142 if (br_should_route_hook) {
144 if (br_should_route_hook(pskb)) 143 if (br_should_route_hook(&skb))
145 return 0; 144 return skb;
146 skb = *pskb;
147 dest = eth_hdr(skb)->h_dest; 145 dest = eth_hdr(skb)->h_dest;
148 } 146 }
149 147
@@ -152,10 +150,10 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)
152 150
153 NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, 151 NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
154 br_handle_frame_finish); 152 br_handle_frame_finish);
155 return 1; 153 return NULL;
156 } 154 }
157 155
158err: 156err:
159 kfree_skb(skb); 157 kfree_skb(skb);
160 return 1; 158 return NULL;
161} 159}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 2b73de6c0b47..fab8ce0ce88d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -182,7 +182,8 @@ extern void br_features_recompute(struct net_bridge *br);
182 182
183/* br_input.c */ 183/* br_input.c */
184extern int br_handle_frame_finish(struct sk_buff *skb); 184extern int br_handle_frame_finish(struct sk_buff *skb);
185extern int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb); 185extern struct sk_buff *br_handle_frame(struct net_bridge_port *p,
186 struct sk_buff *skb);
186 187
187/* br_ioctl.c */ 188/* br_ioctl.c */
188extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 189extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);