From nobody Wed May 14 13:59:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524487529525792.5452977227025; Mon, 23 Apr 2018 05:45:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E35D881DFA; Mon, 23 Apr 2018 12:45:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB7AF8319A; Mon, 23 Apr 2018 12:45:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 59A174CAAA; Mon, 23 Apr 2018 12:45:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCjBrH011888 for ; Mon, 23 Apr 2018 08:45:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1FCE72023227; Mon, 23 Apr 2018 12:45:11 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D33982024CA5 for ; Mon, 23 Apr 2018 12:45:10 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id F24EA120076 for ; Mon, 23 Apr 2018 14:45:07 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 14:44:40 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/29] nwfilter: Add spaces after casts X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 23 Apr 2018 12:45:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- src/nwfilter/nwfilter_dhcpsnoop.c | 14 +++++++------- src/nwfilter/nwfilter_ebiptables_driver.c | 22 +++++++++++----------- src/nwfilter/nwfilter_gentech_driver.c | 6 +++--- src/nwfilter/nwfilter_learnipaddr.c | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 6069e7046075..b29d654e4780 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -319,7 +319,7 @@ virNWFilterSnoopActivate(virNWFilterSnoopReqPtr req) =20 virNWFilterSnoopActiveLock(); =20 - if (virHashAddEntry(virNWFilterSnoopState.active, key, (void *)0x1) < = 0) + if (virHashAddEntry(virNWFilterSnoopState.active, key, (void *) 0x1) <= 0) VIR_FREE(key); =20 virNWFilterSnoopActiveUnlock(); @@ -936,7 +936,7 @@ virNWFilterSnoopDHCPGetOpt(virNWFilterSnoopDHCPHdrPtr p= d, int len, goto malformed; if (*pleasetime) return -1; /* duplicate lease time */ - memcpy(&nwint, (char *)pd->d_opts + oind + 2, sizeof(nwint)); + memcpy(&nwint, (char *) pd->d_opts + oind + 2, sizeof(nwint)); *pleasetime =3D ntohl(nwint); break; case DHCPO_MTYPE: @@ -1017,7 +1017,7 @@ virNWFilterSnoopDHCPDecode(virNWFilterSnoopReqPtr req, */ if (!fromVM) { if (virMacAddrCmpRaw(&req->macaddr, - (unsigned char *)&pd->d_chaddr) !=3D 0) + (unsigned char *) &pd->d_chaddr) !=3D 0) return -2; } =20 @@ -1456,7 +1456,7 @@ virNWFilterDHCPSnoopThread(void *req0) n--; =20 rv =3D pcap_next_ex(pcapConf[i].handle, &hdr, - (const u_char **)&packet); + (const u_char **) &packet); =20 if (rv < 0) { /* error reading from socket */ @@ -1881,7 +1881,7 @@ virNWFilterSnoopSaveIter(void *payload, void *data) { virNWFilterSnoopReqPtr req =3D payload; - int tfd =3D *(int *)data; + int tfd =3D *(int *) data; virNWFilterSnoopIPLeasePtr ipl; =20 /* protect req->start */ @@ -1925,7 +1925,7 @@ virNWFilterSnoopLeaseFileRefresh(void) virNWFilterSnoopPruneIter, NULL); /* now save them */ virHashForEach(virNWFilterSnoopState.snoopReqs, - virNWFilterSnoopSaveIter, (void *)&tfd); + virNWFilterSnoopSaveIter, (void *) &tfd); } =20 if (VIR_CLOSE(tfd) < 0) { @@ -2147,7 +2147,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname) goto cleanup; =20 if (ifname) { - ifkey =3D (char *)virHashLookup(virNWFilterSnoopState.ifnameToKey, + ifkey =3D (char *) virHashLookup(virNWFilterSnoopState.ifnameToKey, ifname); if (!ifkey) goto cleanup; diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index b19b07c84548..9914bf3d6bb0 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -1188,7 +1188,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, =20 PRINT_IPT_ROOT_CHAIN(chain, chainPrefix, ifname); =20 - switch ((int)rule->prtclType) { + switch ((int) rule->prtclType) { case VIR_NWFILTER_RULE_PROTOCOL_TCP: case VIR_NWFILTER_RULE_PROTOCOL_TCPoIPV6: fwrule =3D virFirewallAddRule(fw, layer, @@ -1878,7 +1878,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, #define INST_ITEM_MASK(S, I, MASK, C) \ INST_ITEM_2PARMS(S, I, MASK, C, "/") =20 - switch ((int)rule->prtclType) { + switch ((int) rule->prtclType) { case VIR_NWFILTER_RULE_PROTOCOL_MAC: fwrule =3D virFirewallAddRule(fw, VIR_FIREWALL_LAYER_ETHERNET, "-t", "nat", @@ -2682,7 +2682,7 @@ ebtablesCreateTmpSubChainFW(virFirewallPtr fw, fwrule =3D virFirewallAddRule(fw, VIR_FIREWALL_LAYER_ETHERNET, "-t", "nat", "-A", rootchain, NULL); =20 - switch ((int)protoidx) { + switch ((int) protoidx) { case L2_PROTO_MAC_IDX: break; case L2_PROTO_STP_IDX: @@ -2722,7 +2722,7 @@ ebtablesRemoveSubChainsQuery(virFirewallPtr fw, VIR_DEBUG("Processing chain '%s'", tmp); virFirewallAddRuleFull(fw, VIR_FIREWALL_LAYER_ETHERNET, false, ebtablesRemoveSubChainsQuery, - (void *)chainprefixes, + (void *) chainprefixes, "-t", "nat", "-L", tmp, NULL); virFirewallAddRuleFull(fw, VIR_FIREWALL_LAYER_ETHERNET, true, NULL, NULL, @@ -2750,7 +2750,7 @@ _ebtablesRemoveSubChainsFW(virFirewallPtr fw, PRINT_ROOT_CHAIN(rootchain, chainprefixes[i], ifname); virFirewallAddRuleFull(fw, VIR_FIREWALL_LAYER_ETHERNET, false, ebtablesRemoveSubChainsQuery, - (void *)chainprefixes, + (void *) chainprefixes, "-t", "nat", "-L", rootchain, NULL); } } @@ -3195,8 +3195,8 @@ ebiptablesFilterOrderSort(const virHashKeyValuePair *= a, const virHashKeyValuePair *b) { /* elements' values has been limited to range [-1000, 1000] */ - return *(virNWFilterChainPriority *)a->value - - *(virNWFilterChainPriority *)b->value; + return *(virNWFilterChainPriority *) a->value - + *(virNWFilterChainPriority *) b->value; } =20 =20 @@ -3336,8 +3336,8 @@ struct ebtablesSubChainInst { static int ebtablesSubChainInstSort(const void *a, const void *b) { - const struct ebtablesSubChainInst **insta =3D (const struct ebtablesSu= bChainInst **)a; - const struct ebtablesSubChainInst **instb =3D (const struct ebtablesSu= bChainInst **)b; + const struct ebtablesSubChainInst **insta =3D (const struct ebtablesSu= bChainInst **) a; + const struct ebtablesSubChainInst **instb =3D (const struct ebtablesSu= bChainInst **) b; =20 /* priorities are limited to range [-1000, 1000] */ return (*insta)->priority - (*instb)->priority; @@ -3364,12 +3364,12 @@ ebtablesGetSubChainInsts(virHashTablePtr chains, enum l3_proto_idx idx =3D ebtablesGetProtoIdxByFiltername( filter_names[i].key); =20 - if ((int)idx < 0) + if ((int) idx < 0) continue; =20 if (VIR_ALLOC(inst) < 0) goto cleanup; - inst->priority =3D *(const virNWFilterChainPriority *)filter_names= [i].value; + inst->priority =3D *(const virNWFilterChainPriority *) filter_name= s[i].value; inst->incoming =3D incoming; inst->protoidx =3D idx; inst->filtername =3D filter_names[i].key; diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter= _gentech_driver.c index 5ef26b6afbe0..f0c840bb0ab9 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -225,8 +225,8 @@ printString(void *payload ATTRIBUTE_UNUSED, const void = *name, void *data) { struct printString *ps =3D data; =20 - if ((STREQ((char *)name, NWFILTER_STD_VAR_IP) && !ps->reportIP) || - (STREQ((char *)name, NWFILTER_STD_VAR_MAC) && !ps->reportMAC)) + if ((STREQ((char *) name, NWFILTER_STD_VAR_IP) && !ps->reportIP) || + (STREQ((char *) name, NWFILTER_STD_VAR_MAC) && !ps->reportMAC)) return 0; =20 if (virBufferUse(&ps->buf) && ps->separator) @@ -1078,7 +1078,7 @@ virNWFilterDomainFWUpdateCB(virDomainObjPtr obj, /* filter tree unchanged -- no update needed */ ret =3D virHashAddEntry(cb->skipInterfaces, net->ifname, - (void *)~0); + (void *) ~0); } break; =20 diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index 9ca063957651..4e10f7b4a239 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -356,7 +356,7 @@ procDHCPOpts(struct dhcp *dhcp, int dhcp_opts_len, } } dhcp_opts_len -=3D (2 + dhcpopt->len); - dhcpopt =3D (struct dhcp_option*)((char *)dhcpopt + 2 + dhcpopt->l= en); + dhcpopt =3D (struct dhcp_option*)((char *) dhcpopt + 2 + dhcpopt->= len); } } =20 @@ -499,7 +499,7 @@ learnIPAddressThread(void *arg) =20 case ETHERTYPE_VLAN: ethHdrSize =3D sizeof(struct ether_vlan_header); - vlan_hdr =3D (struct ether_vlan_header *)packet; + vlan_hdr =3D (struct ether_vlan_header *) packet; if (ntohs(vlan_hdr->ether_type) !=3D ETHERTYPE_IP || header.len < ethHdrSize) continue; @@ -567,7 +567,7 @@ learnIPAddressThread(void *arg) sizeof(struct udphdr))) { VIR_WARNINGS_NO_CAST_ALIGN struct udphdr *udphdr =3D (struct udphdr *) - ((char *)iphdr + iphdr->ihl * 4); + ((char *) iphdr + iphdr->ihl * 4= ); VIR_WARNINGS_RESET if (ntohs(udphdr->source) =3D=3D 67 && ntohs(udphdr->dest) =3D=3D 68 && @@ -576,7 +576,7 @@ learnIPAddressThread(void *arg) sizeof(struct udphdr) + sizeof(struct dhcp)) { struct dhcp *dhcp =3D (struct dhcp *) - ((char *)udphdr + sizeof(udphdr)); + ((char *) udphdr + sizeof(udphdr)); if (dhcp->op =3D=3D 2 /* BOOTREPLY */ && virMacAddrCmpRaw( &req->macaddr, --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list