* [PATCH libnetfilter_queue] src: Fix indenting weirdness is pktbuff.c w/out changing indent
@ 2020-01-15 7:52 Duncan Roe
2020-01-16 14:12 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Duncan Roe @ 2020-01-15 7:52 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel
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>
---
| 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index 37f6bc0..b7d379e 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -53,6 +53,7 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
{
struct pkt_buff *pktb;
void *pkt_data;
+ struct ethhdr *ethhdr;
pktb = calloc(1, sizeof(struct pkt_buff) + len + extra);
if (pktb == NULL)
@@ -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;
}
--
2.14.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-16 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 7:52 [PATCH libnetfilter_queue] src: Fix indenting weirdness is pktbuff.c w/out changing indent Duncan Roe
2020-01-16 14:12 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).