OSDN Git Service

vxlan: Fix alignment and code style of vxlan.c
authorNiu Xilei <niu_xilei@163.com>
Mon, 30 Dec 2019 09:52:22 +0000 (17:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jan 2020 23:41:33 +0000 (15:41 -0800)
Fixed Coding function and style issues

Signed-off-by: Niu Xilei <niu_xilei@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index 3ec6b50..e95e658 100644 (file)
@@ -1060,6 +1060,7 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,
                        return err;
        } else {
                union vxlan_addr *remote = &vxlan->default_dst.remote_ip;
+
                if (remote->sa.sa_family == AF_INET) {
                        ip->sin.sin_addr.s_addr = htonl(INADDR_ANY);
                        ip->sa.sa_family = AF_INET;
@@ -1696,7 +1697,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
 
        if (__iptunnel_pull_header(skb, VXLAN_HLEN, protocol, raw_proto,
                                   !net_eq(vxlan->net, dev_net(vxlan->dev))))
-                       goto drop;
+               goto drop;
 
        if (vxlan_collect_metadata(vs)) {
                struct metadata_dst *tun_dst;
@@ -4128,30 +4129,30 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
            nla_put_u8(skb, IFLA_VXLAN_DF, vxlan->cfg.df) ||
            nla_put_be32(skb, IFLA_VXLAN_LABEL, vxlan->cfg.label) ||
            nla_put_u8(skb, IFLA_VXLAN_LEARNING,
-                       !!(vxlan->cfg.flags & VXLAN_F_LEARN)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_LEARN)) ||
            nla_put_u8(skb, IFLA_VXLAN_PROXY,
-                       !!(vxlan->cfg.flags & VXLAN_F_PROXY)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_PROXY)) ||
            nla_put_u8(skb, IFLA_VXLAN_RSC,
                       !!(vxlan->cfg.flags & VXLAN_F_RSC)) ||
            nla_put_u8(skb, IFLA_VXLAN_L2MISS,
-                       !!(vxlan->cfg.flags & VXLAN_F_L2MISS)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_L2MISS)) ||
            nla_put_u8(skb, IFLA_VXLAN_L3MISS,
-                       !!(vxlan->cfg.flags & VXLAN_F_L3MISS)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_L3MISS)) ||
            nla_put_u8(skb, IFLA_VXLAN_COLLECT_METADATA,
                       !!(vxlan->cfg.flags & VXLAN_F_COLLECT_METADATA)) ||
            nla_put_u32(skb, IFLA_VXLAN_AGEING, vxlan->cfg.age_interval) ||
            nla_put_u32(skb, IFLA_VXLAN_LIMIT, vxlan->cfg.addrmax) ||
            nla_put_be16(skb, IFLA_VXLAN_PORT, vxlan->cfg.dst_port) ||
            nla_put_u8(skb, IFLA_VXLAN_UDP_CSUM,
-                       !(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM_TX)) ||
+                      !(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM_TX)) ||
            nla_put_u8(skb, IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
-                       !!(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM6_TX)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM6_TX)) ||
            nla_put_u8(skb, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
-                       !!(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM6_RX)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_UDP_ZERO_CSUM6_RX)) ||
            nla_put_u8(skb, IFLA_VXLAN_REMCSUM_TX,
-                       !!(vxlan->cfg.flags & VXLAN_F_REMCSUM_TX)) ||
+                      !!(vxlan->cfg.flags & VXLAN_F_REMCSUM_TX)) ||
            nla_put_u8(skb, IFLA_VXLAN_REMCSUM_RX,
-                       !!(vxlan->cfg.flags & VXLAN_F_REMCSUM_RX)))
+                      !!(vxlan->cfg.flags & VXLAN_F_REMCSUM_RX)))
                goto nla_put_failure;
 
        if (nla_put(skb, IFLA_VXLAN_PORT_RANGE, sizeof(ports), &ports))