nwfilter: cut off connections after changing filters
nwfilter: cut off connections after changing filters

The following filter transition from a filter allowing incoming TCP connections

  <rule action='accept' direction='in' priority='401'>
    <tcp/>
  </rule>
  <rule action='accept' direction='out' priority='500'>
    <tcp/>
  </rule>

to one that does not allow them

  <rule action='drop' direction='in' priority='401'>
    <tcp/>
  </rule>
  <rule action='accept' direction='out' priority='500'>
    <tcp/>
  </rule>

did previously not cut off existing (ssh) connections but only prevented newly initiated ones. The attached patch allows to cut off existing connections as well, thus enforcing what the filter is showing.

I had only tested with a configuration where the physical interface is connected to the bridge where the filters are applied. This patch now also solves a filtering problem where the physical interface is not connected to the bridge, but the bridge is given an IP address and the host routes between bridge and physical interface. Here the filters drop non-allowed traffic on the outgoing side on the host.

VenkatDatta/libvirt,elmarco/libvirt,jeckersb/libvirt,siboulet/libvirt-openvz,zippy2/libvirt,danwent/libvirt-ovs,libvirt/libvirt,VenkatDatta/libvirt,siboulet/libvirt-openvz,rbu/libvirt,jfehlig/libvirt,rbu/libvirt,leilihh/libvirt,wiedi/libvirt,agx/libvirt,iam-TJ/libvirt,novel/fbsd-libvirt,fabianfreyer/libvirt,jeckersb/libvirt,foomango/libvirt,rmarwaha/libvirt,datto/libvirt,rmarwaha/libvirt1,eskultety/libvirt,trainstack/libvirt,zhlcindy/libvirt-1.1.4-maintain,zippy2/libvirt,jeckersb/libvirt,jeckersb/libvirt,iam-TJ/libvirt,amery/libvirt-vserver,libvirt/libvirt,novel/fbsd-libvirt,wiedi/libvirt,crobinso/libvirt,rlaager/libvirt,kantai/libvirt-vfork,foomango/libvirt,trainstack/libvirt,rlaager/libvirt,elmarco/libvirt,olafhering/libvirt,trainstack/libvirt,emaste/libvirt,VenkatDatta/libvirt,andreabolognani/libvirt,amery/libvirt-vserver,siboulet/libvirt-openvz,datto/libvirt,wiedi/libvirt,amery/libvirt-vserver,shugaoye/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,agx/libvirt,amery/libvirt-vserver,novel/fbsd-libvirt,warewolf/libvirt,bjzhang/libvirt,nertpinx/libvirt,emaste/libvirt,siboulet/libvirt-openvz,libvirt/libvirt,soulxu/libvirt-xuhj,taget/libvirt,danwent/libvirt-ovs,olafhering/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,iam-TJ/libvirt,usc-isi/libvirt,wiedi/libvirt,wiedi/libvirt,elmarco/libvirt,eskultety/libvirt,rmarwaha/libvirt1,jeckersb/libvirt,agx/libvirt,cbosdo/libvirt,soulxu/libvirt-xuhj,crobinso/libvirt,dumbbell/libvirt,novel/fbsd-libvirt,wiedi/libvirt,elmarco/libvirt,shugaoye/libvirt,cbosdo/libvirt,zhlcindy/libvirt-1.1.4-maintain,shugaoye/libvirt,rbu/libvirt,usc-isi/libvirt,novel/fbsd-libvirt,crobinso/libvirt,jfehlig/libvirt,zhlcindy/libvirt-1.1.4-maintain,kantai/libvirt-vfork,cbosdo/libvirt,jfehlig/libvirt,dumbbell/libvirt,dumbbell/libvirt,rmarwaha/libvirt,taget/libvirt,jeckersb/libvirt,rmarwaha/libvirt1,zhlcindy/libvirt-1.1.4-maintain,jfehlig/libvirt,soulxu/libvirt-xuhj,kantai/libvirt-vfork,warewolf/libvirt,foomango/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,emaste/libvirt,agx/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,wiedi/libvirt,eskultety/libvirt,soulxu/libvirt-xuhj,danwent/libvirt-ovs,crobinso/libvirt,rmarwaha/libvirt1,iam-TJ/libvirt,rmarwaha/libvirt,warewolf/libvirt,cbosdo/libvirt,novel/fbsd-libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,rlaager/libvirt,iam-TJ/libvirt,dumbbell/libvirt,emaste/libvirt,andreabolognani/libvirt,emaste/libvirt,amery/libvirt-vserver,shugaoye/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,taget/libvirt,nertpinx/libvirt,leilihh/libvirt,emaste/libvirt,danwent/libvirt-ovs,olafhering/libvirt,bjzhang/libvirt,fabianfreyer/libvirt,rmarwaha/libvirt,leilihh/libvirt,novel/fbsd-libvirt,soulxu/libvirt-xuhj,libvirt/libvirt,leilihh/libvirt,dumbbell/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,shugaoye/libvirt,foomango/libvirt,trainstack/libvirt,usc-isi/libvirt,jardasgit/libvirt,warewolf/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,trainstack/libvirt,jeckersb/libvirt,datto/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,taget/libvirt,trainstack/libvirt,bjzhang/libvirt,leilihh/libvirt,foomango/libvirt,eskultety/libvirt,agx/libvirt,andreabolognani/libvirt,jardasgit/libvirt,usc-isi/libvirt,cbosdo/libvirt,rmarwaha/libvirt1,emaste/libvirt,eskultety/libvirt,datto/libvirt,rmarwaha/libvirt1,nertpinx/libvirt,jardasgit/libvirt,datto/libvirt,jardasgit/libvirt,zippy2/libvirt,warewolf/libvirt,taget/libvirt,rlaager/libvirt,rmarwaha/libvirt,rbu/libvirt,andreabolognani/libvirt,bjzhang/libvirt,dumbbell/libvirt,rbu/libvirt,kantai/libvirt-vfork,siboulet/libvirt-openvz,novel/fbsd-libvirt,warewolf/libvirt,rlaager/libvirt,warewolf/libvirt,trainstack/libvirt,rmarwaha/libvirt,usc-isi/libvirt,zhlcindy/libvirt-1.1.4-maintain,danwent/libvirt-ovs,iam-TJ/libvirt,kantai/libvirt-vfork,elmarco/libvirt,novel/fbsd-libvirt,zippy2/libvirt,olafhering/libvirt,bjzhang/libvirt,iam-TJ/libvirt,leilihh/libvirt