[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1497452134-4867-1-git-send-email-cugyly@163.com>
Date: Wed, 14 Jun 2017 22:55:34 +0800
From: yuan linyu <cugyly@....com>
To: netdev@...r.kernel.org
Cc: "David S . Miller" <davem@...emloft.net>,
yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
Subject: [PATCH net-next 08/11] bridge: skb_put_zero() used to optimize code
From: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
Signed-off-by: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
---
net/bridge/netfilter/nft_reject_bridge.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
index c16dd3a..22a52d5 100644
--- a/net/bridge/netfilter/nft_reject_bridge.c
+++ b/net/bridge/netfilter/nft_reject_bridge.c
@@ -147,8 +147,7 @@ static void nft_reject_br_send_v4_unreach(struct net *net,
net->ipv4.sysctl_ip_default_ttl);
skb_reset_transport_header(nskb);
- icmph = (struct icmphdr *)skb_put(nskb, sizeof(struct icmphdr));
- memset(icmph, 0, sizeof(*icmph));
+ icmph = (struct icmphdr *)skb_put_zero(nskb, sizeof(struct icmphdr));
icmph->type = ICMP_DEST_UNREACH;
icmph->code = code;
@@ -275,8 +274,7 @@ static void nft_reject_br_send_v6_unreach(struct net *net,
net->ipv6.devconf_all->hop_limit);
skb_reset_transport_header(nskb);
- icmp6h = (struct icmp6hdr *)skb_put(nskb, sizeof(struct icmp6hdr));
- memset(icmp6h, 0, sizeof(*icmp6h));
+ icmp6h = (struct icmp6hdr *)skb_put_zero(nskb, sizeof(struct icmp6hdr));
icmp6h->icmp6_type = ICMPV6_DEST_UNREACH;
icmp6h->icmp6_code = code;
--
2.7.4
Powered by blists - more mailing lists