source: trunk/target/linux/generic/patches-3.2/644-bridge_optimize_netfilter_hooks.patch @ 31028

Last change on this file since 31028 was 31028, checked in by juhosg, 5 years ago

kernel: update linux 3.2 to 3.2.12

File size: 3.7 KB
  • net/bridge/br_netfilter.c

    a b static int brnf_filter_pppoe_tagged __re 
    6262#define brnf_filter_pppoe_tagged 0 
    6363#endif 
    6464 
     65bool br_netfilter_run_hooks(void) 
     66{ 
     67        return brnf_call_iptables | brnf_call_ip6tables | brnf_call_arptables; 
     68} 
     69 
    6570static inline __be16 vlan_proto(const struct sk_buff *skb) 
    6671{ 
    6772        if (vlan_tx_tag_present(skb)) 
  • net/bridge/br_private.h

    a b static inline bool br_multicast_is_route 
    491491extern int br_netfilter_init(void); 
    492492extern void br_netfilter_fini(void); 
    493493extern void br_netfilter_rtable_init(struct net_bridge *); 
     494extern bool br_netfilter_run_hooks(void); 
    494495#else 
    495496#define br_netfilter_init()     (0) 
    496497#define br_netfilter_fini()     do { } while(0) 
    497498#define br_netfilter_rtable_init(x) 
     499#define br_netfilter_run_hooks()        false 
    498500#endif 
    499501 
     502static inline int 
     503BR_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, 
     504        struct net_device *in, struct net_device *out, 
     505        int (*okfn)(struct sk_buff *)) 
     506{ 
     507        if (!br_netfilter_run_hooks()) 
     508                return okfn(skb); 
     509 
     510        return NF_HOOK(pf, hook, skb, in, out, okfn); 
     511} 
     512 
    500513/* br_stp.c */ 
    501514extern void br_log_state(const struct net_bridge_port *p); 
    502515extern struct net_bridge_port *br_get_port(struct net_bridge *br, 
  • net/bridge/br_input.c

    a b static int br_pass_frame_up(struct sk_bu 
    4040        indev = skb->dev; 
    4141        skb->dev = brdev; 
    4242 
    43         return NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, 
     43        return BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, 
    4444                       netif_receive_skb); 
    4545} 
    4646 
    rx_handler_result_t br_handle_frame(stru 
    199199                } 
    200200 
    201201                /* Deliver packet to local host only */ 
    202                 if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, 
     202                if (BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, 
    203203                            NULL, br_handle_local_finish)) { 
    204204                        return RX_HANDLER_CONSUMED; /* consumed by filter */ 
    205205                } else { 
    forward: 
    224224                if (!compare_ether_addr(p->br->dev->dev_addr, dest)) 
    225225                        skb->pkt_type = PACKET_HOST; 
    226226 
    227                 NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, 
     227                BR_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, 
    228228                        br_handle_frame_finish); 
    229229                break; 
    230230        default: 
  • net/bridge/br_forward.c

    a b int br_dev_queue_push_xmit(struct sk_buf 
    5555 
    5656int br_forward_finish(struct sk_buff *skb) 
    5757{ 
    58         return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev, 
     58        return BR_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev, 
    5959                       br_dev_queue_push_xmit); 
    6060 
    6161} 
    static void __br_deliver(const struct ne 
    7474                return; 
    7575        } 
    7676 
    77         NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
     77        BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
    7878                br_forward_finish); 
    7979} 
    8080 
    static void __br_forward(const struct ne 
    9191        skb->dev = to->dev; 
    9292        skb_forward_csum(skb); 
    9393 
    94         NF_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, 
     94        BR_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, 
    9595                br_forward_finish); 
    9696} 
    9797 
  • net/bridge/br_multicast.c

    a b static void __br_multicast_send_query(st 
    827827        if (port) { 
    828828                __skb_push(skb, sizeof(struct ethhdr)); 
    829829                skb->dev = port->dev; 
    830                 NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
     830                BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
    831831                        dev_queue_xmit); 
    832832        } else 
    833833                netif_rx(skb); 
  • net/bridge/br_stp_bpdu.c

    a b static void br_send_bpdu(struct net_brid 
    5252 
    5353        skb_reset_mac_header(skb); 
    5454 
    55         NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
     55        BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, 
    5656                dev_queue_xmit); 
    5757} 
    5858 
Note: See TracBrowser for help on using the repository browser.