If the routing table that I wanna flush has 60 entries or more, "ip route flush table foo" fails with the following error: Failed to send flush request: Success Flush terminated My emerge --info: Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.29-gentoo-r5 i686) ================================================================= System uname: Linux-2.6.29-gentoo-r5-i686-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-glibc2.0 Timestamp of tree: Fri, 19 Jun 2009 08:45:02 +0000 distcc 3.1 i686-pc-linux-gnu [disabled] app-shells/bash: 3.2_p39 dev-java/java-config: 2.1.7 dev-lang/python: 2.5.4-r2 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.7.9-r1, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib/fax /var/bind /var/spool/fax/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.mirrors.lug.ro/gentoo ftp://ftp.roedu.net/pub/mirrors/gentoo.org ftp://ftp.lug.ro/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="en ro fr de" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/src/modified-ebuilds" SYNC="rsync://rsync.ro.gentoo.org/gentoo-portage" USE="accounting acl alsa apache2 authdaemond bcmath berkdb bzip2 calendar cgi cli cracklib crypt ctype cups curl dba directfb dri encode esd expat extensions fam fbcon fortran ftp gd gdbm geoip gif gmp gpm hardenedphp hash iconv idn imagemagick imap imlib ipv6 isdnlog java javacomm javadoc javamail jikes jpeg junit ldap logrotate mad maildir math mcal mgetty mhash midi mmx mozilla mp3 mpeg mpm-worker mudflap mysql ncurses nls nptl nptlonly nsplugin ogg openmp oss pam pcre pear perl php png posix pppd python readline reflection samba sasl session slang sockets spamassassin spell spl ssl suexec svg svga swat sysfs sysvipc tcpd threads tiff truetype unicode usb vhosts vorbis webdav x86 xattr xerces xml xml2 xmlrpc xorg xpm xsl yaz zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ro fr de" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
iproute2-2.6.29.1 has the same problem. Most probably the bug is within the kernel.
I was wrong, the problem lies in iproute2 code. The application use the same netlink socket for retrieving the current routes and for issuing RTM_DELROUTE commands. When it sends the first batch of RTM_DELROUTE commands, it waits for the result, but the reply it gets is composed by a bunch of RTM_GETROUTE resulted by the dump request. I was able to fix it by using 2 netlink sockets, one for retrieving the current routes and the other one used for deleting them. Probably needs to be fixed for other ip commands that accepts the "flush" verb, like ip addr.
Since no-one seems to be interested in fixing this (not even upstream), I took the matter into my own hands. Fixed in 2.6.29.1-r1 and 9999.
i cleaned up the patch you committed did you e-mail the patch upstream ?
It seems the patch is no longer necesary. The bug has been fixed with a different approach: http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=commitdiff;h=2d8240f8d95dfdc276dcf447623129fb5ccedcd6 http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=commitdiff;h=24f38182441868f27aec03e82105eb008127e879 and: http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=commitdiff;h=b49240ec7eab91418d2f090536bf8cd2205988d6
thanks ... ive dropped the patch in iproute2-2.6.31+