summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2020-01-15 18:52:03 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-01-16 15:11:36 +0100
commit04ad0b1c48c67d31b82b1f95eee9c1d541f2df59 (patch)
tree82494e0cc137e9ab777e729cee7ab35a7e83f79c /src
parent833afb11adf0aefb46b6a021a49c3ecf6b278ab9 (diff)
src: Fix indenting weirdness is pktbuff.c w/out changing indent
In pktb_alloc, declare struct ethhdr *ethhdr at function start, thus avoiding cute braces on case AF_BRIDGE. This costs nothing and generates less code. Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/extra/pktbuff.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index 37f6bc0..f013cfe 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -52,6 +52,7 @@ EXPORT_SYMBOL
struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
{
struct pkt_buff *pktb;
+ struct ethhdr *ethhdr;
void *pkt_data;
pktb = calloc(1, sizeof(struct pkt_buff) + len + extra);
@@ -74,9 +75,8 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
case AF_INET6:
pktb->network_header = pktb->data;
break;
- case AF_BRIDGE: {
- struct ethhdr *ethhdr = (struct ethhdr *)pktb->data;
-
+ case AF_BRIDGE:
+ ethhdr = (struct ethhdr *)pktb->data;
pktb->mac_header = pktb->data;
switch(ethhdr->h_proto) {
@@ -92,7 +92,6 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
}
break;
}
- }
return pktb;
}