Indent top-level labels by one space in src/nwfilter/

This commit is contained in:
Ján Tomko 2014-03-25 07:56:49 +01:00
parent c97cfce291
commit 5d8315975e
5 changed files with 60 additions and 60 deletions

View File

@ -498,7 +498,7 @@ virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl,
req->filtername, req->filtername,
req->vars); req->vars);
exit_snooprequnlock: exit_snooprequnlock:
virNWFilterSnoopReqUnlock(req); virNWFilterSnoopReqUnlock(req);
VIR_FREE(ipaddr); VIR_FREE(ipaddr);
@ -605,10 +605,10 @@ virNWFilterSnoopReqNew(const char *ifkey)
return req; return req;
err_destroy_mutex: err_destroy_mutex:
virMutexDestroy(&req->lock); virMutexDestroy(&req->lock);
err_free_req: err_free_req:
VIR_FREE(req); VIR_FREE(req);
return NULL; return NULL;
@ -786,7 +786,7 @@ virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req,
virAtomicIntInc(&virNWFilterSnoopState.nLeases); virAtomicIntInc(&virNWFilterSnoopState.nLeases);
exit: exit:
if (update_leasefile) if (update_leasefile)
virNWFilterSnoopLeaseFileSave(pl); virNWFilterSnoopLeaseFileSave(pl);
@ -897,12 +897,12 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
} }
skip_instantiate: skip_instantiate:
VIR_FREE(ipl); VIR_FREE(ipl);
virAtomicIntDecAndTest(&virNWFilterSnoopState.nLeases); virAtomicIntDecAndTest(&virNWFilterSnoopState.nLeases);
lease_not_found: lease_not_found:
VIR_FREE(ipstr); VIR_FREE(ipstr);
virNWFilterSnoopReqUnlock(req); virNWFilterSnoopReqUnlock(req);
@ -960,7 +960,7 @@ virNWFilterSnoopDHCPGetOpt(virNWFilterSnoopDHCPHdrPtr pd, int len,
oind += pd->d_opts[oind + 1] + 2; oind += pd->d_opts[oind + 1] + 2;
} }
return 0; return 0;
malformed: malformed:
VIR_WARN("got lost in the options!"); VIR_WARN("got lost in the options!");
return -1; return -1;
} }
@ -1149,11 +1149,11 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac,
return handle; return handle;
cleanup_freecode: cleanup_freecode:
pcap_freecode(&fp); pcap_freecode(&fp);
cleanup: cleanup:
pcap_close(handle); pcap_close(handle);
cleanup_nohandle: cleanup_nohandle:
VIR_FREE(ext_filter); VIR_FREE(ext_filter);
return NULL; return NULL;
@ -1562,7 +1562,7 @@ virNWFilterDHCPSnoopThread(void *req0)
virNWFilterSnoopReqUnlock(req); virNWFilterSnoopReqUnlock(req);
virNWFilterSnoopUnlock(); virNWFilterSnoopUnlock();
exit: exit:
virThreadPoolFree(worker); virThreadPoolFree(worker);
virNWFilterSnoopReqPut(req); virNWFilterSnoopReqPut(req);
@ -1731,15 +1731,15 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
return 0; return 0;
exit_snoop_cancel: exit_snoop_cancel:
virNWFilterSnoopCancel(&req->threadkey); virNWFilterSnoopCancel(&req->threadkey);
exit_snoopreq_unlock: exit_snoopreq_unlock:
virNWFilterSnoopReqUnlock(req); virNWFilterSnoopReqUnlock(req);
exit_rem_ifnametokey: exit_rem_ifnametokey:
virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey, ifname); virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey, ifname);
exit_snoopunlock: exit_snoopunlock:
virNWFilterSnoopUnlock(); virNWFilterSnoopUnlock();
exit_snoopreqput: exit_snoopreqput:
if (!threadPuts) if (!threadPuts)
virNWFilterSnoopReqPut(req); virNWFilterSnoopReqPut(req);
@ -1799,7 +1799,7 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *ifkey,
ignore_value(fsync(lfd)); ignore_value(fsync(lfd));
cleanup: cleanup:
VIR_FREE(lbuf); VIR_FREE(lbuf);
VIR_FREE(dhcpstr); VIR_FREE(dhcpstr);
VIR_FREE(ipstr); VIR_FREE(ipstr);
@ -1831,7 +1831,7 @@ virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLeasePtr ipl)
virAtomicIntGet(&virNWFilterSnoopState.nLeases) * 20) virAtomicIntGet(&virNWFilterSnoopState.nLeases) * 20)
virNWFilterSnoopLeaseFileLoad(); /* load & refresh lease file */ virNWFilterSnoopLeaseFileLoad(); /* load & refresh lease file */
err_exit: err_exit:
virNWFilterSnoopUnlock(); virNWFilterSnoopUnlock();
} }
@ -1935,7 +1935,7 @@ virNWFilterSnoopLeaseFileRefresh(void)
} }
virAtomicIntSet(&virNWFilterSnoopState.wLeases, 0); virAtomicIntSet(&virNWFilterSnoopState.wLeases, 0);
skip_rename: skip_rename:
virNWFilterSnoopLeaseFileOpen(); virNWFilterSnoopLeaseFileOpen();
} }
@ -2107,7 +2107,7 @@ virNWFilterDHCPSnoopInit(void)
return 0; return 0;
err_exit: err_exit:
virHashFree(virNWFilterSnoopState.ifnameToKey); virHashFree(virNWFilterSnoopState.ifnameToKey);
virNWFilterSnoopState.ifnameToKey = NULL; virNWFilterSnoopState.ifnameToKey = NULL;
@ -2182,7 +2182,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname)
virNWFilterSnoopLeaseFileLoad(); virNWFilterSnoopLeaseFileLoad();
} }
cleanup: cleanup:
virNWFilterSnoopUnlock(); virNWFilterSnoopUnlock();
} }

View File

@ -245,23 +245,23 @@ nwfilterStateInitialize(bool privileged,
return 0; return 0;
error: error:
VIR_FREE(base); VIR_FREE(base);
nwfilterDriverUnlock(driverState); nwfilterDriverUnlock(driverState);
nwfilterStateCleanup(); nwfilterStateCleanup();
return -1; return -1;
err_techdrivers_shutdown: err_techdrivers_shutdown:
virNWFilterTechDriversShutdown(); virNWFilterTechDriversShutdown();
err_dhcpsnoop_shutdown: err_dhcpsnoop_shutdown:
virNWFilterDHCPSnoopShutdown(); virNWFilterDHCPSnoopShutdown();
err_exit_learnshutdown: err_exit_learnshutdown:
virNWFilterLearnShutdown(); virNWFilterLearnShutdown();
err_exit_ipaddrmapshutdown: err_exit_ipaddrmapshutdown:
virNWFilterIPAddrMapShutdown(); virNWFilterIPAddrMapShutdown();
err_free_driverstate: err_free_driverstate:
VIR_FREE(driverState); VIR_FREE(driverState);
return -1; return -1;
@ -378,7 +378,7 @@ nwfilterLookupByUUID(virConnectPtr conn,
ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid); ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid);
cleanup: cleanup:
if (nwfilter) if (nwfilter)
virNWFilterObjUnlock(nwfilter); virNWFilterObjUnlock(nwfilter);
return ret; return ret;
@ -408,7 +408,7 @@ nwfilterLookupByName(virConnectPtr conn,
ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid); ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid);
cleanup: cleanup:
if (nwfilter) if (nwfilter)
virNWFilterObjUnlock(nwfilter); virNWFilterObjUnlock(nwfilter);
return ret; return ret;
@ -588,7 +588,7 @@ nwfilterDefineXML(virConnectPtr conn,
ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid); ret = virGetNWFilter(conn, nwfilter->def->name, nwfilter->def->uuid);
cleanup: cleanup:
virNWFilterDefFree(def); virNWFilterDefFree(def);
if (nwfilter) if (nwfilter)
virNWFilterObjUnlock(nwfilter); virNWFilterObjUnlock(nwfilter);
@ -637,7 +637,7 @@ nwfilterUndefine(virNWFilterPtr obj)
nwfilter = NULL; nwfilter = NULL;
ret = 0; ret = 0;
cleanup: cleanup:
if (nwfilter) if (nwfilter)
virNWFilterObjUnlock(nwfilter); virNWFilterObjUnlock(nwfilter);
@ -673,7 +673,7 @@ nwfilterGetXMLDesc(virNWFilterPtr obj,
ret = virNWFilterDefFormat(nwfilter->def); ret = virNWFilterDefFormat(nwfilter->def);
cleanup: cleanup:
if (nwfilter) if (nwfilter)
virNWFilterObjUnlock(nwfilter); virNWFilterObjUnlock(nwfilter);
return ret; return ret;

View File

@ -978,7 +978,7 @@ iptablesHandleSrcMacAddr(virBufferPtr buf,
return 0; return 0;
err_exit: err_exit:
virBufferFreeAndReset(buf); virBufferFreeAndReset(buf);
return -1; return -1;
@ -1174,7 +1174,7 @@ iptablesHandleIpHdr(virBufferPtr buf,
return 0; return 0;
err_exit: err_exit:
virBufferFreeAndReset(buf); virBufferFreeAndReset(buf);
virBufferFreeAndReset(afterStateMatch); virBufferFreeAndReset(afterStateMatch);
@ -1246,7 +1246,7 @@ iptablesHandlePortData(virBufferPtr buf,
return 0; return 0;
err_exit: err_exit:
return -1; return -1;
} }
@ -1741,14 +1741,14 @@ _iptablesCreateRuleInstance(bool directionIn,
(isIPv6) ? RT_IP6TABLES : RT_IPTABLES); (isIPv6) ? RT_IP6TABLES : RT_IPTABLES);
err_exit: err_exit:
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
virBufferFreeAndReset(&prefix); virBufferFreeAndReset(&prefix);
virBufferFreeAndReset(&afterStateMatch); virBufferFreeAndReset(&afterStateMatch);
return -1; return -1;
exit_no_error: exit_no_error:
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
virBufferFreeAndReset(&prefix); virBufferFreeAndReset(&prefix);
virBufferFreeAndReset(&afterStateMatch); virBufferFreeAndReset(&afterStateMatch);
@ -2628,7 +2628,7 @@ ebtablesCreateRuleInstance(char chainPrefix,
rule->priority, rule->priority,
RT_EBTABLES); RT_EBTABLES);
err_exit: err_exit:
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
return -1; return -1;
@ -3281,7 +3281,7 @@ ebtablesApplyBasicRules(const char *ifname,
return 0; return 0;
tear_down_tmpebchains: tear_down_tmpebchains:
ebtablesCleanAll(ifname); ebtablesCleanAll(ifname);
virReportError(VIR_ERR_BUILD_FIREWALL, virReportError(VIR_ERR_BUILD_FIREWALL,
@ -3429,7 +3429,7 @@ ebtablesApplyDHCPOnlyRules(const char *ifname,
return 0; return 0;
tear_down_tmpebchains: tear_down_tmpebchains:
ebtablesCleanAll(ifname); ebtablesCleanAll(ifname);
virReportError(VIR_ERR_BUILD_FIREWALL, virReportError(VIR_ERR_BUILD_FIREWALL,
@ -3499,7 +3499,7 @@ ebtablesApplyDropAllRules(const char *ifname)
return 0; return 0;
tear_down_tmpebchains: tear_down_tmpebchains:
ebtablesCleanAll(ifname); ebtablesCleanAll(ifname);
virReportError(VIR_ERR_BUILD_FIREWALL, virReportError(VIR_ERR_BUILD_FIREWALL,
@ -3565,7 +3565,7 @@ ebiptablesRuleOrderSort(const void *a, const void *b)
if (root_b) { if (root_b) {
return 1; /* b before a */ return 1; /* b before a */
} }
normal: normal:
/* priorities are limited to range [-1000, 1000] */ /* priorities are limited to range [-1000, 1000] */
return insta->priority - instb->priority; return insta->priority - instb->priority;
} }
@ -3911,7 +3911,7 @@ ebiptablesApplyNewRules(const char *ifname,
return 0; return 0;
tear_down_ebsubchains_and_unlink: tear_down_ebsubchains_and_unlink:
if (ebtables_cmd_path) { if (ebtables_cmd_path) {
NWFILTER_SET_EBTABLES_SHELLVAR(&buf); NWFILTER_SET_EBTABLES_SHELLVAR(&buf);
@ -3919,7 +3919,7 @@ tear_down_ebsubchains_and_unlink:
ebtablesUnlinkTmpRootChain(&buf, false, ifname); ebtablesUnlinkTmpRootChain(&buf, false, ifname);
} }
tear_down_tmpip6tchains: tear_down_tmpip6tchains:
if (haveIp6tables) { if (haveIp6tables) {
NWFILTER_SET_IP6TABLES_SHELLVAR(&buf); NWFILTER_SET_IP6TABLES_SHELLVAR(&buf);
@ -3927,7 +3927,7 @@ tear_down_tmpip6tchains:
iptablesRemoveTmpRootChains(&buf, ifname); iptablesRemoveTmpRootChains(&buf, ifname);
} }
tear_down_tmpiptchains: tear_down_tmpiptchains:
if (haveIptables) { if (haveIptables) {
NWFILTER_SET_IPTABLES_SHELLVAR(&buf); NWFILTER_SET_IPTABLES_SHELLVAR(&buf);
@ -3935,7 +3935,7 @@ tear_down_tmpiptchains:
iptablesRemoveTmpRootChains(&buf, ifname); iptablesRemoveTmpRootChains(&buf, ifname);
} }
tear_down_tmpebchains: tear_down_tmpebchains:
if (ebtables_cmd_path) { if (ebtables_cmd_path) {
NWFILTER_SET_EBTABLES_SHELLVAR(&buf); NWFILTER_SET_EBTABLES_SHELLVAR(&buf);
@ -3953,7 +3953,7 @@ tear_down_tmpebchains:
errmsg ? ": " : "", errmsg ? ": " : "",
errmsg ? errmsg : ""); errmsg ? errmsg : "");
exit_free_sets: exit_free_sets:
virHashFree(chains_in_set); virHashFree(chains_in_set);
virHashFree(chains_out_set); virHashFree(chains_out_set);
@ -4083,7 +4083,7 @@ ebiptablesRemoveRules(const char *ifname ATTRIBUTE_UNUSED,
rc = 0; rc = 0;
cleanup: cleanup:
return rc; return rc;
} }
@ -4209,7 +4209,7 @@ ebiptablesDriverInitWithFirewallD(void)
} }
} }
err_exit: err_exit:
VIR_FREE(firewall_cmd_path); VIR_FREE(firewall_cmd_path);
VIR_FREE(output); VIR_FREE(output);
@ -4365,7 +4365,7 @@ ebiptablesDriverProbeStateMatch(void)
m_state_in_str = m_state_in_str_new; m_state_in_str = m_state_in_str_new;
} }
cleanup: cleanup:
VIR_FREE(cmdout); VIR_FREE(cmdout);
return; return;
} }

View File

@ -345,7 +345,7 @@ virNWFilterCreateVarsFrom(virNWFilterHashTablePtr vars1,
return res; return res;
err_exit: err_exit:
virNWFilterHashTableFree(res); virNWFilterHashTableFree(res);
return NULL; return NULL;
} }
@ -768,7 +768,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
virNWFilterUnlockIface(ifname); virNWFilterUnlockIface(ifname);
} }
err_exit: err_exit:
for (j = 0; j < nEntries; j++) for (j = 0; j < nEntries; j++)
virNWFilterRuleInstFree(insts[j]); virNWFilterRuleInstFree(insts[j]);
@ -780,7 +780,7 @@ err_exit:
return rc; return rc;
err_unresolvable_vars: err_unresolvable_vars:
buf = virNWFilterPrintVars(missing_vars->hashTable, ", ", false, reportIP); buf = virNWFilterPrintVars(missing_vars->hashTable, ", ", false, reportIP);
if (buf) { if (buf) {
@ -906,10 +906,10 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
virNWFilterHashTableFree(vars); virNWFilterHashTableFree(vars);
err_exit_vars1: err_exit_vars1:
virNWFilterHashTableFree(vars1); virNWFilterHashTableFree(vars1);
err_exit: err_exit:
virNWFilterObjUnlock(obj); virNWFilterObjUnlock(obj);
VIR_FREE(str_ipaddr); VIR_FREE(str_ipaddr);
@ -961,7 +961,7 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
false, false,
foundNewFilter); foundNewFilter);
cleanup: cleanup:
virMutexUnlock(&updateMutex); virMutexUnlock(&updateMutex);
return rc; return rc;

View File

@ -761,13 +761,13 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
return 0; return 0;
err_dereg_req: err_dereg_req:
virNWFilterDeregisterLearnReq(ifindex); virNWFilterDeregisterLearnReq(ifindex);
err_free_ht: err_free_ht:
virNWFilterHashTableFree(ht); virNWFilterHashTableFree(ht);
err_free_req: err_free_req:
virNWFilterIPAddrLearnReqFree(req); virNWFilterIPAddrLearnReqFree(req);
err_no_req: err_no_req:
return -1; return -1;
} }