diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-09-22 07:28:16 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-09-26 12:42:30 -0400 |
commit | 7276ca3fa23864133f5ee7431c51546d9b7f695f (patch) | |
tree | 7f092d8fe6c15560941665f80d6481d42d13c204 /net/bridge | |
parent | 772476df7047db87ac4174d1ed396512912d23bf (diff) |
netfilter: bridge: nf_bridge_copy_header as static inline in header
Move nf_bridge_copy_header() as static inline in netfilter_bridge.h
header file. This patch prepares the modularization of the br_netfilter
code.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index a615264cf01a..61929a7cd815 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -245,14 +245,6 @@ static inline void nf_bridge_save_header(struct sk_buff *skb) | |||
245 | skb->nf_bridge->data, header_size); | 245 | skb->nf_bridge->data, header_size); |
246 | } | 246 | } |
247 | 247 | ||
248 | static inline void nf_bridge_update_protocol(struct sk_buff *skb) | ||
249 | { | ||
250 | if (skb->nf_bridge->mask & BRNF_8021Q) | ||
251 | skb->protocol = htons(ETH_P_8021Q); | ||
252 | else if (skb->nf_bridge->mask & BRNF_PPPoE) | ||
253 | skb->protocol = htons(ETH_P_PPP_SES); | ||
254 | } | ||
255 | |||
256 | /* When handing a packet over to the IP layer | 248 | /* When handing a packet over to the IP layer |
257 | * check whether we have a skb that is in the | 249 | * check whether we have a skb that is in the |
258 | * expected format | 250 | * expected format |
@@ -320,26 +312,6 @@ drop: | |||
320 | return -1; | 312 | return -1; |
321 | } | 313 | } |
322 | 314 | ||
323 | /* Fill in the header for fragmented IP packets handled by | ||
324 | * the IPv4 connection tracking code. | ||
325 | */ | ||
326 | int nf_bridge_copy_header(struct sk_buff *skb) | ||
327 | { | ||
328 | int err; | ||
329 | unsigned int header_size; | ||
330 | |||
331 | nf_bridge_update_protocol(skb); | ||
332 | header_size = ETH_HLEN + nf_bridge_encap_header_len(skb); | ||
333 | err = skb_cow_head(skb, header_size); | ||
334 | if (err) | ||
335 | return err; | ||
336 | |||
337 | skb_copy_to_linear_data_offset(skb, -header_size, | ||
338 | skb->nf_bridge->data, header_size); | ||
339 | __skb_push(skb, nf_bridge_encap_header_len(skb)); | ||
340 | return 0; | ||
341 | } | ||
342 | |||
343 | /* PF_BRIDGE/PRE_ROUTING *********************************************/ | 315 | /* PF_BRIDGE/PRE_ROUTING *********************************************/ |
344 | /* Undo the changes made for ip6tables PREROUTING and continue the | 316 | /* Undo the changes made for ip6tables PREROUTING and continue the |
345 | * bridge PRE_ROUTING hook. */ | 317 | * bridge PRE_ROUTING hook. */ |