Simple script to 'git blame' on new Coverity issues

- Pass an email in to stdin and the script produces output similar
to:

Hi,

Please find the latest report on new defect(s) introduced to fd.io VPP
found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)

** CID 167726:  Resource leaks  (RESOURCE_LEAK)
/src/vnet/devices/af_packet/device.c: 215 in
af_packet_interface_admin_up_down()

________________________________________________________________________________________________________
*** CID 167726:  Resource leaks  (RESOURCE_LEAK)
/src/vnet/devices/af_packet/device.c: 215 in
af_packet_interface_admin_up_down()
>>>     CID 167726:  Resource leaks  (RESOURCE_LEAK)
>>>     Handle variable "fd" going out of scope leaks the handle.
00a9dcad vnet/vnet/devices/af_packet/device.c (Damjan Marion 2016-08-17
209)   af_packet_if_t *apif =
00a9dcad vnet/vnet/devices/af_packet/device.c (Damjan Marion 2016-08-17
210)     pool_elt_at_index (apm->interfaces, hw->dev_instance);
83cc4e14 vnet/vnet/devices/af_packet/device.c (Alpesh Patel  2016-04-05
211)   u32 hw_flags;
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
212)   int rv, fd = socket (AF_UNIX, SOCK_DGRAM, 0);
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
213)   struct ifreq ifr;
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
214)
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
215)   /* if interface is a bridge ignore */
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
216)   if (apif->host_if_index < 0)
2038ad01 src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-05-18
217)     goto error;			/* no error */
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
218)
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
219)   /* use host_if_index in case host name has changed */
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
220)   ifr.ifr_ifindex = apif->host_if_index;
** CID 167725:  Error handling issues  (NEGATIVE_RETURNS)
/src/vnet/devices/af_packet/device.c: 252 in
af_packet_interface_admin_up_down()

________________________________________________________________________________________________________
*** CID 167725:  Error handling issues  (NEGATIVE_RETURNS)
/src/vnet/devices/af_packet/device.c: 252 in
af_packet_interface_admin_up_down()
>>>     CID 167725:  Error handling issues  (NEGATIVE_RETURNS)
>>>     "fd" is passed to a parameter that cannot be negative.
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
246)     }
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
247)
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
248)   if ((rv = ioctl (fd, SIOCSIFFLAGS, &ifr)) < 0)
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
249)     {
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
250)       clib_unix_warning ("af_packet_%s error: %d",
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
251) 			 apif->is_admin_up ? "up" : "down", rv);
2038ad01 src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-05-18
252)       goto error;
c855b73f src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-04-21
253)     }
83cc4e14 vnet/vnet/devices/af_packet/device.c (Alpesh Patel  2016-04-05
254)
00a9dcad vnet/vnet/devices/af_packet/device.c (Damjan Marion 2016-08-17
255)   vnet_hw_interface_set_flags (vnm, hw_if_index, hw_flags);
83cc4e14 vnet/vnet/devices/af_packet/device.c (Alpesh Patel  2016-04-05
256)
2038ad01 src/vnet/devices/af_packet/device.c  (Ray Kinsella  2017-05-18
257) error:

Change-Id: I9756c16ea24e7520704155ae1f6c5f132087e3bc
Signed-off-by: Chris Luke <chrisy@flirble.org>
1 file changed
tree: 9f347ad22ebc3ae0a3288aea7299e90b094ab519
  1. build-data/
  2. build-root/
  3. doxygen/
  4. dpdk/
  5. extras/
  6. gmod/
  7. src/
  8. test/
  9. .gitignore
  10. .gitreview
  11. LICENSE
  12. MAINTAINERS
  13. Makefile
  14. README.md
  15. RELEASE.md
README.md

Vector Packet Processing

Introduction

The VPP platform is an extensible framework that provides out-of-the-box production quality switch/router functionality. It is the open source version of Cisco's Vector Packet Processing (VPP) technology: a high performance, packet-processing stack that can run on commodity CPUs.

The benefits of this implementation of VPP are its high performance, proven technology, its modularity and flexibility, and rich feature set.

For more information on VPP and its features please visit the FD.io website and What is VPP? pages.

Changes

Details of the changes leading up to this version of VPP can be found under @ref release_notes.

Directory layout

Directory nameDescription
build-dataBuild metadata
build-rootBuild output directory
doxygenDocumentation generator configuration
dpdkDPDK patches and build infrastructure
@ref srcVPP source code
@ref src/pluginsVPP bundled plugins directory
@ref src/svmShared virtual memory allocation library
src/testsUnit tests
src/vatVPP API test program
@ref src/vlibVPP application library
@ref src/vlibapiVPP API library
@ref src/vlibmemoryVPP Memory management
@ref src/vlibsocketVPP Socket I/O
@ref src/vnetVPP networking
@ref src/vppVPP application
@ref src/vpp-apiVPP application API bindings
@ref src/vppinfraVPP core library
testUnit tests
@ref src/vpp/apiNot-yet-relocated API bindings

Getting started

In general anyone interested in building, developing or running VPP should consult the VPP wiki for more complete documentation.

In particular, readers are recommended to take a look at [Pulling, Building, Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step coverage of the topic.

For the impatient, some salient information is distilled below.

Quick-start: On an existing Linux host

To install system dependencies, build VPP and then install it, simply run the build script. This should be performed a non-privileged user with sudo access from the project base directory:

./extras/vagrant/build.sh

If you want a more fine-grained approach because you intend to do some development work, the Makefile in the root directory of the source tree provides several convenience shortcuts as make targets that may be of interest. To see the available targets run:

make

Quick-start: Vagrant

The directory extras/vagrant contains a VagrantFile and supporting scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine. This VM can then be used to test concepts with VPP or as a development platform to extend VPP. Some obvious caveats apply when using a VM for VPP since its performance will never match that of bare metal; if your work is timing or performance sensitive, consider using bare metal in addition or instead of the VM.

For this to work you will need a working installation of Vagrant. Instructions for this can be found [on the Setting up Vagrant wiki page] (https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).

More information

Several modules provide documentation, see @subpage user_doc for more information.

Visit the VPP wiki for details on more advanced building strategies and development notes.

Test Framework

There is PyDoc generated documentation available for the VPP test framework. See @subpage test_framework_doc for details.