From: <kr...@us...> - 2007-02-23 19:44:31
|
Revision: 651 http://svn.sourceforge.net/astlinux/?rev=651&view=rev Author: krisk84 Date: 2007-02-23 11:44:32 -0800 (Fri, 23 Feb 2007) Log Message: ----------- merge rt support into trunk Modified Paths: -------------- trunk/astlinux.config trunk/package/Config.in trunk/package/madwifi/madwifi.mk trunk/package/mqueue-isdn/mqueue-isdn.mk trunk/package/nistnet/nistnet.mk trunk/package/unionfs/unionfs.mk trunk/package/zaptel/zaptel-makefile0.patch trunk/package/zaptel/zaptel.mk trunk/target/device/geni586/Config.in trunk/target/device/geni586/linux.config trunk/target/device/geni586/linux.mk trunk/target/device/net4801/Config.in trunk/target/device/net4801/linux.config trunk/target/device/net4801/linux.mk trunk/target/device/via/Config.in trunk/target/device/via/linux.config trunk/target/device/via/linux.mk trunk/target/device/wrap/Config.in trunk/target/device/wrap/linux.config trunk/target/device/wrap/linux.mk trunk/target/initrd/initrd.mk Added Paths: ----------- trunk/package/madwifi/rt-madwifi.patch trunk/package/mqueue-isdn/rt-mqueue-isdn.patch trunk/package/nistnet/rt-nistnet.patch trunk/package/schedutils/ trunk/package/schedutils/Config.in trunk/package/schedutils/schedutils.mk trunk/package/wanpipe/wanpipe-utilfix.patch trunk/package/zaptel/rt-zaptel.patch trunk/target/device/geni586/kernel-patches/linux-multi-routes-2.6.20.patch trunk/target/device/geni586/kernel-patches/linux-squashfs3.2-r2.patch trunk/target/device/geni586/kernel-patches/linux-unionfs.patch trunk/target/device/geni586/kernel-patches/rt-linux-2.6.20-rt5.patch trunk/target/device/geni586/rt-linux.config trunk/target/device/net4801/kernel-patches/linux-multi-routes-2.6.20.patch trunk/target/device/net4801/kernel-patches/linux-squashfs3.2-r2.patch trunk/target/device/net4801/kernel-patches/linux-unionfs.patch trunk/target/device/net4801/kernel-patches/rt-linux-2.6.20-rt5.patch trunk/target/device/net4801/rt-linux.config trunk/target/device/via/kernel-patches/linux-multi-routes-2.6.20.patch trunk/target/device/via/kernel-patches/linux-squashfs3.2-r2.patch trunk/target/device/via/kernel-patches/linux-unionfs.patch trunk/target/device/via/kernel-patches/rt-linux-2.6.20-rt5.patch trunk/target/device/via/rt-linux.config trunk/target/device/wrap/kernel-patches/linux-multi-routes-2.6.20.patch trunk/target/device/wrap/kernel-patches/linux-squashfs3.2-r2.patch trunk/target/device/wrap/kernel-patches/linux-unionfs.patch trunk/target/device/wrap/kernel-patches/rt-linux-2.6.20-rt5.patch trunk/target/device/wrap/rt-linux.config Removed Paths: ------------- trunk/package/schedutils/Config.in trunk/package/schedutils/schedutils.mk trunk/target/device/geni586/kernel-patches/linux-multi-routes-2.6.19.patch trunk/target/device/geni586/kernel-patches/linux-squashfs3.2.patch trunk/target/device/net4801/kernel-patches/linux-multi-routes-2.6.19.patch trunk/target/device/net4801/kernel-patches/linux-squashfs3.2.patch trunk/target/device/via/kernel-patches/linux-multi-routes-2.6.19.patch trunk/target/device/via/kernel-patches/linux-squashfs3.2.patch trunk/target/device/wrap/kernel-patches/linux-multi-routes-2.6.19.patch trunk/target/device/wrap/kernel-patches/linux-squashfs3.2.patch trunk/target/device/wrap/kernel-patches/linux-wrapleds.patch Modified: trunk/astlinux.config =================================================================== --- trunk/astlinux.config 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/astlinux.config 2007-02-23 19:44:32 UTC (rev 651) @@ -302,6 +302,7 @@ BR2_PACKAGE_RSYNC=y # BR2_PACKAGE_RUBY is not set # BR2_PACKAGE_RXVT is not set +BR2_PACKAGE_SCHEDUTILS=y BR2_PACKAGE_SCREEN=y # BR2_PACKAGE_SDL is not set BR2_PACKAGE_SFDISK=y @@ -328,7 +329,7 @@ BR2_PACKAGE_TTCP=y # BR2_PACKAGE_UDEV is not set # BR2_PACKAGE_UDHCP is not set -BR2_PACKAGE_UNIONFS=y +# BR2_PACKAGE_UNIONFS is not set BR2_PACKAGE_USBUTILS=y # BR2_PACKAGE_UTIL-LINUX is not set # BR2_PACKAGE_VALGRIND is not set @@ -342,7 +343,7 @@ # BR2_PACKAGE_XFSPROGS is not set # BR2_PACKAGE_XORG is not set BR2_PACKAGE_ZAPTEL=y -BR2_PACKAGE_ZAPTEL_RHINO=y +# BR2_PACKAGE_ZAPTEL_RHINO is not set BR2_PACKAGE_ZLIB=y # BR2_PACKAGE_ZLIB_TARGET_HEADERS is not set @@ -391,4 +392,5 @@ # BR2_TARGET_PCENGINES_WRAP is not set BR2_TARGET_GENI586=y # BR2_TARGET_GENI586_SERIAL is not set +BR2_TARGET_RT=y # BR2_TARGET_VIA is not set Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/Config.in 2007-02-23 19:44:32 UTC (rev 651) @@ -154,6 +154,7 @@ source "package/rsync/Config.in" source "package/ruby/Config.in" source "package/rxvt/Config.in" +source "package/schedutils/Config.in" source "package/screen/Config.in" source "package/sdl/Config.in" source "package/sfdisk/Config.in" Modified: trunk/package/madwifi/madwifi.mk =================================================================== --- trunk/package/madwifi/madwifi.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/madwifi/madwifi.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -3,7 +3,7 @@ # madwifi # ############################################################## -MADWIFI_VERSION := r1784-20061027 +MADWIFI_VERSION := r2116-20070215 MADWIFI_SOURCE := madwifi-ng-$(MADWIFI_VERSION).tar.gz MADWIFI_SITE := http://snapshots.madwifi.org/madwifi-ng MADWIFI_DIR := $(BUILD_DIR)/madwifi-ng-$(MADWIFI_VERSION) @@ -17,7 +17,10 @@ $(MADWIFI_DIR)/.source: $(DL_DIR)/$(MADWIFI_SOURCE) zcat $(DL_DIR)/$(MADWIFI_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - # toolchain/patch-kernel.sh $(MADWIFI_DIR) package/madwifi/ madwifi\*.patch +ifeq ($(strip $(BR2_TARGET_RT)),y) + toolchain/patch-kernel.sh $(MADWIFI_DIR) package/madwifi/ rt\*.patch +endif + toolchain/patch-kernel.sh $(MADWIFI_DIR) package/madwifi/ madwifi\*.patch touch $(MADWIFI_DIR)/.source $(MADWIFI_DIR)/.configured: $(MADWIFI_DIR)/.source Copied: trunk/package/madwifi/rt-madwifi.patch (from rev 650, branches/rt/package/madwifi/rt-madwifi.patch) =================================================================== --- trunk/package/madwifi/rt-madwifi.patch (rev 0) +++ trunk/package/madwifi/rt-madwifi.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,12 @@ +diff -ur madwifi-ng-r2116-20070215.orig/ath/if_ath_pci.c madwifi-ng-r2116-20070215/ath/if_ath_pci.c +--- madwifi-ng-r2116-20070215.orig/ath/if_ath_pci.c 2007-01-21 22:07:30.000000000 -0500 ++++ madwifi-ng-r2116-20070215/ath/if_ath_pci.c 2007-02-15 14:25:59.000000000 -0500 +@@ -207,7 +207,7 @@ + + pci_set_drvdata(pdev, dev); + +- if (request_irq(dev->irq, ath_intr, SA_SHIRQ, dev->name, dev)) { ++ if (request_irq(dev->irq, ath_intr, IRQF_SHARED, dev->name, dev)) { + printk(KERN_WARNING "%s: request_irq failed\n", dev->name); + goto bad3; + } Modified: trunk/package/mqueue-isdn/mqueue-isdn.mk =================================================================== --- trunk/package/mqueue-isdn/mqueue-isdn.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/mqueue-isdn/mqueue-isdn.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -27,6 +27,9 @@ touch $(MQUEUEISDN_DIR)/.unpacked $(MQUEUEISDN_DIR)/.configured: $(MQUEUEISDN_DIR)/.unpacked +ifeq ($(strip $(BR2_TARGET_RT)),y) + toolchain/patch-kernel.sh $(MQUEUEISDN_DIR)/mISDN package/mqueue-isdn/ rt\*.patch +endif toolchain/patch-kernel.sh $(MQUEUEISDN_DIR)/mISDN package/mqueue-isdn/ mqueue-isdn\*.patch toolchain/patch-kernel.sh $(MQUEUEISDN_DIR)/mISDNuser package/mqueue-isdn/ mqueue-user-isdn\*.patch toolchain/patch-kernel.sh $(MQUEUEISDN_DIR)/mISDNuser/i4lnet package/mqueue-isdn/ i4lmake.patch Copied: trunk/package/mqueue-isdn/rt-mqueue-isdn.patch (from rev 650, branches/rt/package/mqueue-isdn/rt-mqueue-isdn.patch) =================================================================== --- trunk/package/mqueue-isdn/rt-mqueue-isdn.patch (rev 0) +++ trunk/package/mqueue-isdn/rt-mqueue-isdn.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,105 @@ +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/avm_fritz.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/avm_fritz.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/avm_fritz.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/avm_fritz.c 2007-02-14 17:13:31.000000000 -0500 +@@ -872,7 +872,7 @@ + static int init_card(fritzpnppci *fc) + { + int cnt = 3; +- u_int shared = SA_SHIRQ; ++ u_int shared = IRQF_SHARED; + u_long flags; + u_char *id = "AVM Fritz!PCI"; + +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfc_multi.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfc_multi.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfc_multi.c 2007-01-23 10:01:40.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfc_multi.c 2007-02-14 17:14:02.000000000 -0500 +@@ -120,7 +120,7 @@ + #define bugtest \ + if (hc->irq) free_irq(hc->irq, hc); \ + hc->irq = 0; \ +- if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, SA_SHIRQ, "HFC-multi", hc)) { \ ++ if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, IRQF_SHARED, "HFC-multi", hc)) { \ + printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n", hc->pci_dev->irq); \ + hc->irq = hc->pci_dev->irq; } + #endif +@@ -3208,7 +3208,7 @@ + disable_hwirq(hc); + spin_unlock_irqrestore(&hc->lock, flags); + +- if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, SA_SHIRQ, "HFC-multi", hc)) { ++ if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, IRQF_SHARED, "HFC-multi", hc)) { + printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n", hc->pci_dev->irq); + return(-EIO); + } +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfc_pci.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfc_pci.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfc_pci.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfc_pci.c 2007-02-14 17:15:31.000000000 -0500 +@@ -1693,7 +1693,7 @@ + spin_lock_irqsave(&hc->lock, flags); + disable_hwirq(hc); + spin_unlock_irqrestore(&hc->lock, flags); +- if (request_irq(hc->irq, hfcpci_interrupt, SA_SHIRQ, "HFC PCI", hc)) { ++ if (request_irq(hc->irq, hfcpci_interrupt, IRQF_SHARED, "HFC PCI", hc)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", hc->irq); + return(-EIO); + } +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfcs_mini.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfcs_mini.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/hfcs_mini.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/hfcs_mini.c 2007-02-14 17:15:50.000000000 -0500 +@@ -1588,7 +1588,7 @@ + printk(KERN_WARNING "%s %s: requesting IRQ %d\n", + hw->card_name, __FUNCTION__, hw->irq); + +- if (request_irq(hw->irq, hfcsmini_interrupt, SA_SHIRQ, "HFC-S mini", hw)) { ++ if (request_irq(hw->irq, hfcsmini_interrupt, IRQF_SHARED, "HFC-S mini", hw)) { + printk(KERN_WARNING "%s %s: couldn't get interrupt %d\n", + hw->card_name, __FUNCTION__, hw->irq); + +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/netjet.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/netjet.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/netjet.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/netjet.c 2007-02-14 17:16:09.000000000 -0500 +@@ -1538,7 +1538,7 @@ + nj_disable_hwirq(card); + spin_unlock_irqrestore(&card->lock, flags); + +- if (request_irq(card->irq, nj_interrupt, SA_SHIRQ, "NETjet", card)) { ++ if (request_irq(card->irq, nj_interrupt, IRQF_SHARED, "NETjet", card)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", + card->irq); + return (-EIO); +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/sedl_fax.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/sedl_fax.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/sedl_fax.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/sedl_fax.c 2007-02-14 17:16:40.000000000 -0500 +@@ -339,7 +339,7 @@ + { + int cnt = 3; + u_long flags; +- u_int shared = SA_SHIRQ; ++ u_int shared = IRQF_SHARED; + void *irq_func = speedfax_pci_interrupt; + + if (sf->subtyp == SEDL_SPEEDFAX_ISA) { +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/w6692.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/w6692.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/w6692.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/w6692.c 2007-02-14 17:16:55.000000000 -0500 +@@ -995,7 +995,7 @@ + spin_lock_irqsave(&card->lock, flags); + disable_hwirq(card); + spin_unlock_irqrestore(&card->lock, flags); +- if (request_irq(card->irq, w6692_interrupt, SA_SHIRQ, "w6692", card)) { ++ if (request_irq(card->irq, w6692_interrupt, IRQF_SHARED, "w6692", card)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", card->irq); + return(-EIO); + } +diff -ur mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/xhfc_su.c mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/xhfc_su.c +--- mISDN-CVS-2007-01-26.orig/drivers/isdn/hardware/mISDN/xhfc_su.c 2006-12-21 10:25:06.000000000 -0500 ++++ mISDN-CVS-2007-01-26/drivers/isdn/hardware/mISDN/xhfc_su.c 2007-02-14 17:17:35.000000000 -0500 +@@ -2033,7 +2033,7 @@ + } + + /* init interrupt engine */ +- if (request_irq(pi->irq, xhfc_interrupt, SA_SHIRQ, "XHFC", pi)) { ++ if (request_irq(pi->irq, xhfc_interrupt, IRQF_SHARED, "XHFC", pi)) { + printk(KERN_WARNING "%s %s: couldn't get interrupt %d\n", + pi->name, __FUNCTION__, pi->irq); + pi->irq = 0; Modified: trunk/package/nistnet/nistnet.mk =================================================================== --- trunk/package/nistnet/nistnet.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/nistnet/nistnet.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -16,6 +16,9 @@ $(NISTNET_DIR)/.source: $(DL_DIR)/$(NISTNET_SOURCE) zcat $(DL_DIR)/$(NISTNET_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +ifeq ($(strip $(BR2_TARGET_RT)),y) + toolchain/patch-kernel.sh $(NISTNET_DIR) package/nistnet/ rt\*.patch +endif toolchain/patch-kernel.sh $(NISTNET_DIR) package/nistnet/ nistnet\*.patch touch $(NISTNET_DIR)/.source Copied: trunk/package/nistnet/rt-nistnet.patch (from rev 650, branches/rt/package/nistnet/rt-nistnet.patch) =================================================================== --- trunk/package/nistnet/rt-nistnet.patch (rev 0) +++ trunk/package/nistnet/rt-nistnet.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,21 @@ +diff -ur nistnet-3.0a.orig/kernel/fast_rtc.c nistnet-3.0a/kernel/fast_rtc.c +--- nistnet-3.0a.orig/kernel/fast_rtc.c 2005-06-17 13:06:03.000000000 -0400 ++++ nistnet-3.0a/kernel/fast_rtc.c 2007-02-15 14:33:46.000000000 -0500 +@@ -430,7 +430,7 @@ + * get by without it? + */ + /* @@ Need to add hpet interrupt handler option... */ +- if (request_irq(RTC_IRQ, fast_rtc_interrupt, SA_INTERRUPT, ++ if (request_irq(RTC_IRQ, fast_rtc_interrupt, IRQF_DISABLED, + "fast_rtc", NULL)) { + #ifdef CONFIG_RTC_AGGRESSIVE + /* Get rid of any current handler (better - remove/restore) */ +@@ -439,7 +439,7 @@ + #endif + free_irq(RTC_IRQ, NULL); + #endif /* CONFIG_RTC_AGGRESSIVE */ +- if(request_irq(RTC_IRQ, fast_rtc_interrupt, SA_INTERRUPT, ++ if(request_irq(RTC_IRQ, fast_rtc_interrupt, IRQF_DISABLED, + "fast_rtc", NULL)) { + printk(KERN_ERR "install_fast_timer: couldn't free IRQ %d\n", + RTC_IRQ); Copied: trunk/package/schedutils (from rev 650, branches/rt/package/schedutils) Deleted: trunk/package/schedutils/Config.in =================================================================== --- branches/rt/package/schedutils/Config.in 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/schedutils/Config.in 2007-02-23 19:44:32 UTC (rev 651) @@ -1,5 +0,0 @@ -config BR2_PACKAGE_SCHEDUTILS - bool "schedutils" - default n - help - userspace utilities to twiddle RT PREEMPT patches Copied: trunk/package/schedutils/Config.in (from rev 650, branches/rt/package/schedutils/Config.in) =================================================================== --- trunk/package/schedutils/Config.in (rev 0) +++ trunk/package/schedutils/Config.in 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,5 @@ +config BR2_PACKAGE_SCHEDUTILS + bool "schedutils" + default n + help + userspace utilities to twiddle RT PREEMPT patches Deleted: trunk/package/schedutils/schedutils.mk =================================================================== --- branches/rt/package/schedutils/schedutils.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/schedutils/schedutils.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -1,48 +0,0 @@ -############################################################# -# -# schedutils support -# -############################################################# -SCHEDUTILS_SOURCE=schedutils-1.5.0.tar.gz -SCHEDUTILS_SITE:=http://rlove.org/schedutils -SCHEDUTILS_DIR=$(BUILD_DIR)/schedutils-1.5.0 - -$(DL_DIR)/$(SCHEDUTILS_SOURCE): - $(WGET) -P $(DL_DIR) $(SCHEDUTILS_SITE)/$(SCHEDUTILS_SOURCE) - -$(SCHEDUTILS_DIR): $(DL_DIR)/$(SCHEDUTILS_SOURCE) - zcat $(DL_DIR)/$(SCHEDUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - -$(SCHEDUTILS_DIR)/.configured: $(SCHEDUTILS_DIR) - # toolchain/patch-kernel.sh $(SCHEDUTILS_DIR) package/schedutils/ schedutils\*.patch - touch $(SCHEDUTILS_DIR)/.configured - -$(SCHEDUTILS_DIR)/chrt: $(SCHEDUTILS_DIR)/.configured - $(MAKE) CC=$(TARGET_CC) -C $(SCHEDUTILS_DIR) chrt - $(STRIP) $(SCHEDUTILS_DIR)/chrt - touch -c $(SCHEDUTILS_DIR)/schedutils - -$(TARGET_DIR)/sbin/chrt: $(SCHEDUTILS_DIR)/chrt - $(INSTALL) -D -m 0755 $(SCHEDUTILS_DIR)/chrt $(TARGET_DIR)/sbin/chrt - $(STRIP) $(TARGET_DIR)/sbin/chrt - touch -c $(TARGET_DIR)/sbin/chrt - -schedutils: uclibc $(TARGET_DIR)/sbin/chrt - -schedutils-source: $(DL_DIR)/$(SCHEDUTILS_SOURCE) - -schedutils-clean: - rm -f $(TARGET_DIR)/sbin/chrt - -$(MAKE) -C $(SCHEDUTILS_DIR) clean - -schedutils-dirclean: - rm -rf $(SCHEDUTILS_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(strip $(BR2_PACKAGE_SCHEDUTILS)),y) -TARGETS+=schedutils -endif Copied: trunk/package/schedutils/schedutils.mk (from rev 650, branches/rt/package/schedutils/schedutils.mk) =================================================================== --- trunk/package/schedutils/schedutils.mk (rev 0) +++ trunk/package/schedutils/schedutils.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,48 @@ +############################################################# +# +# schedutils support +# +############################################################# +SCHEDUTILS_SOURCE=schedutils-1.5.0.tar.gz +SCHEDUTILS_SITE:=http://rlove.org/schedutils +SCHEDUTILS_DIR=$(BUILD_DIR)/schedutils-1.5.0 + +$(DL_DIR)/$(SCHEDUTILS_SOURCE): + $(WGET) -P $(DL_DIR) $(SCHEDUTILS_SITE)/$(SCHEDUTILS_SOURCE) + +$(SCHEDUTILS_DIR): $(DL_DIR)/$(SCHEDUTILS_SOURCE) + zcat $(DL_DIR)/$(SCHEDUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + +$(SCHEDUTILS_DIR)/.configured: $(SCHEDUTILS_DIR) + # toolchain/patch-kernel.sh $(SCHEDUTILS_DIR) package/schedutils/ schedutils\*.patch + touch $(SCHEDUTILS_DIR)/.configured + +$(SCHEDUTILS_DIR)/chrt: $(SCHEDUTILS_DIR)/.configured + $(MAKE) CC=$(TARGET_CC) -C $(SCHEDUTILS_DIR) chrt + $(STRIP) $(SCHEDUTILS_DIR)/chrt + touch -c $(SCHEDUTILS_DIR)/schedutils + +$(TARGET_DIR)/sbin/chrt: $(SCHEDUTILS_DIR)/chrt + $(INSTALL) -D -m 0755 $(SCHEDUTILS_DIR)/chrt $(TARGET_DIR)/sbin/chrt + $(STRIP) $(TARGET_DIR)/sbin/chrt + touch -c $(TARGET_DIR)/sbin/chrt + +schedutils: uclibc $(TARGET_DIR)/sbin/chrt + +schedutils-source: $(DL_DIR)/$(SCHEDUTILS_SOURCE) + +schedutils-clean: + rm -f $(TARGET_DIR)/sbin/chrt + -$(MAKE) -C $(SCHEDUTILS_DIR) clean + +schedutils-dirclean: + rm -rf $(SCHEDUTILS_DIR) + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_SCHEDUTILS)),y) +TARGETS+=schedutils +endif Modified: trunk/package/unionfs/unionfs.mk =================================================================== --- trunk/package/unionfs/unionfs.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/unionfs/unionfs.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -25,7 +25,7 @@ $(UNIONFS_DIR)/$(UNIONFS_BINARY): $(UNIONFS_DIR)/.configured $(MAKE) -C $(UNIONFS_DIR) CC=$(TARGET_CC) KVERS=2.6 MODDIR=$(TARGET_DIR)/lib/modules/$(LINUX_VER) \ - LINUXSRC=$(BUILD_DIR)/linux PWD=$(UNIONFS_DIR) + LINUXSRC=$(BUILD_DIR)/linux PWD=$(UNIONFS_DIR) EXTRACFLAGS=-DUNIONFS_UNSUPPORTED $(TARGET_DIR)/lib/modules/$(LINUX_VER)/kernel/fs/unionfs/$(UNIONFS_BINARY): $(UNIONFS_DIR)/$(UNIONFS_BINARY) $(INSTALL) -D -m 0755 $(UNIONFS_DIR)/utils/unionctl $(TARGET_DIR)/sbin/unionctl Copied: trunk/package/wanpipe/wanpipe-utilfix.patch (from rev 650, branches/rt/package/wanpipe/wanpipe-utilfix.patch) =================================================================== --- trunk/package/wanpipe/wanpipe-utilfix.patch (rev 0) +++ trunk/package/wanpipe/wanpipe-utilfix.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,12 @@ +diff -ur wanpipe.orig/util/Makefile wanpipe/util/Makefile +--- wanpipe.orig/util/Makefile 2007-02-22 12:08:02.000000000 -0500 ++++ wanpipe/util/Makefile 2007-02-22 17:02:39.000000000 -0500 +@@ -28,7 +28,7 @@ + make -C wanpipemon install WAN_VIRTUAL=$(WAN_VIRTUAL) + make -C wanpipemon_legacy install WAN_VIRTUAL=$(WAN_VIRTUAL) + make -C wancfg install WAN_VIRTUAL=$(WAN_VIRTUAL) +- make -C bwm install SYSINC=$(SYSINC) PROTOCOL_DEFS=$(PROTOCOL_DEFS) ++ make -C bwm install SYSINC=$(SYSINC) PROTOCOL_DEFS=$(PROTOCOL_DEFS) WAN_VIRTUAL=$(WAN_VIRTUAL) + make -C wancfg_zaptel install WAN_VIRTUAL=$(WAN_VIRTUAL) + + uninstall: Copied: trunk/package/zaptel/rt-zaptel.patch (from rev 650, branches/rt/package/zaptel/rt-zaptel.patch) =================================================================== --- trunk/package/zaptel/rt-zaptel.patch (rev 0) +++ trunk/package/zaptel/rt-zaptel.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -0,0 +1,147 @@ +diff -ur zaptel-1.2.13.orig/pciradio.c zaptel-1.2.13/pciradio.c +--- zaptel-1.2.13.orig/pciradio.c 2007-01-31 09:06:34.000000000 -0500 ++++ zaptel-1.2.13/pciradio.c 2007-02-14 16:26:36.000000000 -0500 +@@ -1711,7 +1711,7 @@ + + } + +- if (request_irq(pdev->irq, pciradio_interrupt, SA_SHIRQ, "pciradio", rad)) { ++ if (request_irq(pdev->irq, pciradio_interrupt, IRQF_SHARED, "pciradio", rad)) { + printk("pciradio: Unable to request IRQ %d\n", pdev->irq); + if (rad->freeregion) + release_region(rad->ioaddr, 0xff); +diff -ur zaptel-1.2.13.orig/tor2.c zaptel-1.2.13/tor2.c +--- zaptel-1.2.13.orig/tor2.c 2007-01-31 19:55:41.000000000 -0500 ++++ zaptel-1.2.13/tor2.c 2007-02-14 16:41:13.000000000 -0500 +@@ -534,7 +534,7 @@ + for (x = 0; x < 256; x++) tor->mem32[x] = 0x7f7f7f7f; + + +- if (request_irq(tor->irq, tor2_intr, SA_INTERRUPT | SA_SHIRQ, "tor2", tor)) { ++ if (request_irq(tor->irq, tor2_intr, IRQF_DISABLED | IRQF_SHARED, "tor2", tor)) { + printk(KERN_ERR "Unable to request tormenta IRQ %d\n", tor->irq); + goto err_out_release_all; + } +diff -ur zaptel-1.2.13.orig/torisa.c zaptel-1.2.13/torisa.c +--- zaptel-1.2.13.orig/torisa.c 2007-01-31 09:06:34.000000000 -0500 ++++ zaptel-1.2.13/torisa.c 2007-02-14 16:41:33.000000000 -0500 +@@ -1070,7 +1070,7 @@ + printk(KERN_ERR "No ISA tormenta card found at %05lx\n", base); + return -EIO; + } +- if (request_irq(irq, torisa_intr, SA_INTERRUPT, "torisa", NULL)) { ++ if (request_irq(irq, torisa_intr, IRQF_DISABLED, "torisa", NULL)) { + printk(KERN_ERR "Unable to request tormenta IRQ %d\n", irq); + return -EIO; + } +diff -ur zaptel-1.2.13.orig/wcfxo.c zaptel-1.2.13/wcfxo.c +--- zaptel-1.2.13.orig/wcfxo.c 2007-01-31 09:06:34.000000000 -0500 ++++ zaptel-1.2.13/wcfxo.c 2007-02-14 16:27:52.000000000 -0500 +@@ -895,7 +895,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, wcfxo_interrupt, SA_SHIRQ, "wcfxo", wc)) { ++ if (request_irq(pdev->irq, wcfxo_interrupt, IRQF_SHARED, "wcfxo", wc)) { + printk("wcfxo: Unable to request IRQ %d\n", pdev->irq); + if (wc->freeregion) + release_region(wc->ioaddr, 0xff); +diff -ur zaptel-1.2.13.orig/wct1xxp.c zaptel-1.2.13/wct1xxp.c +--- zaptel-1.2.13.orig/wct1xxp.c 2007-01-31 19:55:41.000000000 -0500 ++++ zaptel-1.2.13/wct1xxp.c 2007-02-14 16:41:55.000000000 -0500 +@@ -1295,7 +1295,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, t1xxp_interrupt, SA_INTERRUPT | SA_SHIRQ, "t1xxp", wc)) { ++ if (request_irq(pdev->irq, t1xxp_interrupt, IRQF_DISABLED | IRQF_SHARED, "t1xxp", wc)) { + printk("t1xxp: Unable to request IRQ %d\n", pdev->irq); + kfree(wc); + return -EIO; +diff -ur zaptel-1.2.13.orig/wct4xxp/base.c zaptel-1.2.13/wct4xxp/base.c +--- zaptel-1.2.13.orig/wct4xxp/base.c 2007-02-07 16:22:44.000000000 -0500 ++++ zaptel-1.2.13/wct4xxp/base.c 2007-02-14 16:47:43.000000000 -0500 +@@ -3206,14 +3206,14 @@ + + + #ifdef SUPPORT_GEN1 +- if (request_irq(pdev->irq, (dt->flags & FLAG_2NDGEN) ? t4_interrupt_gen2 :t4_interrupt, SA_INTERRUPT | SA_SHIRQ, (wc->numspans == 2) ? "wct2xxp" : "wct4xxp", wc)) ++ if (request_irq(pdev->irq, (dt->flags & FLAG_2NDGEN) ? t4_interrupt_gen2 :t4_interrupt, IRQF_DISABLED | IRQF_SHARED, (wc->numspans == 2) ? "wct2xxp" : "wct4xxp", wc)) + #else + if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN)) { + printk("This driver does not support 1st gen modules\n"); + kfree(wc); + return -ENODEV; + } +- if (request_irq(pdev->irq, t4_interrupt_gen2, SA_INTERRUPT | SA_SHIRQ, "t4xxp", wc)) ++ if (request_irq(pdev->irq, t4_interrupt_gen2, IRQF_DISABLED | IRQF_SHARED, "t4xxp", wc)) + #endif + { + printk("t4xxp: Unable to request IRQ %d\n", pdev->irq); +diff -ur zaptel-1.2.13.orig/wctc4xxp/base.c zaptel-1.2.13/wctc4xxp/base.c +--- zaptel-1.2.13.orig/wctc4xxp/base.c 2007-02-07 14:52:52.000000000 -0500 ++++ zaptel-1.2.13/wctc4xxp/base.c 2007-02-14 16:44:03.000000000 -0500 +@@ -1636,7 +1636,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, wcdte_interrupt, SA_SHIRQ, "tc400b", wc)) { ++ if (request_irq(pdev->irq, wcdte_interrupt, IRQF_SHARED, "tc400b", wc)) { + printk("wcdte error: Unable to request IRQ %d\n", pdev->irq); + if (wc->freeregion) + release_region(wc->iobase, 0xff); +diff -ur zaptel-1.2.13.orig/wctdm24xxp.c zaptel-1.2.13/wctdm24xxp.c +--- zaptel-1.2.13.orig/wctdm24xxp.c 2007-01-31 09:06:34.000000000 -0500 ++++ zaptel-1.2.13/wctdm24xxp.c 2007-02-14 16:28:36.000000000 -0500 +@@ -2779,7 +2779,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, wctdm_interrupt, SA_SHIRQ, wc->variety, wc)) { ++ if (request_irq(pdev->irq, wctdm_interrupt, IRQF_SHARED, wc->variety, wc)) { + printk("wctdm24xxp: Unable to request IRQ %d\n", pdev->irq); + if (wc->freeregion) + release_region(wc->iobase, 0xff); +diff -ur zaptel-1.2.13.orig/wctdm.c zaptel-1.2.13/wctdm.c +--- zaptel-1.2.13.orig/wctdm.c 2007-01-31 09:06:34.000000000 -0500 ++++ zaptel-1.2.13/wctdm.c 2007-02-14 16:28:52.000000000 -0500 +@@ -2236,7 +2236,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, wctdm_interrupt, SA_SHIRQ, "wctdm", wc)) { ++ if (request_irq(pdev->irq, wctdm_interrupt, IRQF_SHARED, "wctdm", wc)) { + printk("wctdm: Unable to request IRQ %d\n", pdev->irq); + if (wc->freeregion) + release_region(wc->ioaddr, 0xff); +diff -ur zaptel-1.2.13.orig/wcte11xp.c zaptel-1.2.13/wcte11xp.c +--- zaptel-1.2.13.orig/wcte11xp.c 2007-01-23 16:28:14.000000000 -0500 ++++ zaptel-1.2.13/wcte11xp.c 2007-02-14 16:42:11.000000000 -0500 +@@ -1452,7 +1452,7 @@ + /* Keep track of which device we are */ + pci_set_drvdata(pdev, wc); + +- if (request_irq(pdev->irq, t1xxp_interrupt, SA_INTERRUPT | SA_SHIRQ, "wcte11xp", wc)) { ++ if (request_irq(pdev->irq, t1xxp_interrupt, IRQF_DISABLED | IRQF_SHARED, "wcte11xp", wc)) { + printk("wcte11xp: Unable to request IRQ %d\n", pdev->irq); + kfree(wc); + return -EIO; +diff -ur zaptel-1.2.13.orig/ztdummy.c zaptel-1.2.13/ztdummy.c +--- zaptel-1.2.13.orig/ztdummy.c 2007-01-31 14:01:33.000000000 -0500 ++++ zaptel-1.2.13/ztdummy.c 2007-02-14 16:29:54.000000000 -0500 +@@ -265,13 +265,13 @@ + irq=s->irq; + spin_lock_irq(&mylock); + free_irq(s->irq, s); /* remove uhci_interrupt temporaly */ +- if (request_irq (irq, ztdummy_interrupt, SA_SHIRQ, "ztdummy", ztd)) { ++ if (request_irq (irq, ztdummy_interrupt, IRQF_SHARED, "ztdummy", ztd)) { + spin_unlock_irq(&mylock); + err("Our request_irq %d failed!",irq); + kfree(ztd); + return -EIO; + } /* we add our handler first, to assure, that our handler gets called first */ +- if (request_irq (irq, uhci_interrupt, SA_SHIRQ, s->uhci_pci->driver->name, s)) { ++ if (request_irq (irq, uhci_interrupt, IRQF_SHARED, s->uhci_pci->driver->name, s)) { + spin_unlock_irq(&mylock); + err("Original request_irq %d failed!",irq); + } Modified: trunk/package/zaptel/zaptel-makefile0.patch =================================================================== --- trunk/package/zaptel/zaptel-makefile0.patch 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/zaptel/zaptel-makefile0.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -1,23 +1,15 @@ ---- zaptel/Makefile.orig 2006-12-06 18:22:11.000000000 -0500 -+++ zaptel/Makefile 2006-12-18 22:28:10.000000000 -0500 -@@ -46,6 +46,7 @@ +diff -ur zaptel-1.2.13.orig/Makefile zaptel-1.2.13/Makefile +--- zaptel-1.2.13.orig/Makefile 2007-02-05 16:54:40.000000000 -0500 ++++ zaptel-1.2.13/Makefile 2007-02-14 16:17:34.000000000 -0500 +@@ -6,6 +6,7 @@ + # - KFLAGS+=-DSTANDALONE_ZAPATA - CFLAGS+=-DSTANDALONE_ZAPATA + CFLAGS+=-DSTANDALONE_ZAPATA -DBUILDING_TONEZONE +INSTALL_BASE=/usr - KMAKE:= $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) - KMAKE_INST:= $(KMAKE) INSTALL_MOD_PATH=$(INSTALL_PREFIX) INSTALL_MOD_DIR=misc modules_install -@@ -130,7 +131,7 @@ - obj-m+=xpp/ - endif - --ifneq (,$(wildcard /usr/include/newt.h)) -+ifneq (,$(wildcard $(INSTALL_BASE)/include/newt.h)) - ZTTOOL:=zttool - endif - BINS=ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL) zttest fxotune -@@ -194,13 +195,13 @@ + ifeq ($(MAKELEVEL),0) + PWD:=$(shell pwd) +@@ -224,13 +225,13 @@ $(CC) -o $@ $^ tones.h: gendigits @@ -34,7 +26,7 @@ gendigits: gendigits.o $(CC) -o $@ $^ -lm -@@ -316,13 +317,13 @@ +@@ -344,13 +345,13 @@ $(MAKE) -C mISDNuser install install: all devices firmware @@ -52,7 +44,7 @@ ifeq ($(BUILDVER),linux26) for x in $(MODULESKO); do \ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \ -@@ -337,25 +338,18 @@ +@@ -366,25 +367,18 @@ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \ fi; \ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o @@ -66,7 +58,7 @@ + $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ - $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) -- if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi +- if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then /sbin/restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi - install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h - install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h - install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h @@ -74,7 +66,7 @@ - install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8 - [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : - [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE) -- build_tools/genmodconf $(BUILDVER) "$(INSTALL_PREFIX)" "$(filter-out zaptel,$(MODULES))" +- build_tools/genmodconf $(BUILDVER) "$(INSTALL_PREFIX)" "$(filter-out zaptel ztdummy zttranscode wctc4xxp,$(MODULES)) $(MODULE_ALIASES)" - @if [ -d /etc/modutils ]; then \ - /sbin/update-modules ; \ - fi Modified: trunk/package/zaptel/zaptel.mk =================================================================== --- trunk/package/zaptel/zaptel.mk 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/package/zaptel/zaptel.mk 2007-02-23 19:44:32 UTC (rev 651) @@ -3,7 +3,7 @@ # zaptel # ############################################################## -ZAPTEL_VERSION := 1.2.12 +ZAPTEL_VERSION := 1.2.13 ZAPTEL_SOURCE := zaptel-$(ZAPTEL_VERSION).tar.gz ZAPTEL_SITE := ftp://ftp.digium.com/pub/zaptel/releases ZAPTEL_DIR := $(BUILD_DIR)/zaptel-$(ZAPTEL_VERSION) @@ -40,6 +40,9 @@ $(ZAPTEL_DIR)/.source: $(DL_DIR)/$(ZAPTEL_SOURCE) zcat $(DL_DIR)/$(ZAPTEL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - ln -sf $(ZAPTEL_DIR) $(BUILD_DIR)/zaptel +ifeq ($(strip $(BR2_TARGET_RT)),y) + toolchain/patch-kernel.sh $(ZAPTEL_DIR) package/zaptel/ rt\*.patch +endif toolchain/patch-kernel.sh $(ZAPTEL_DIR) package/zaptel/ zaptel\*.patch ifeq ($(BR2_PACKAGE_ZAPTEL_RHINO),y) zcat $(DL_DIR)/$(RHINO_PKG) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - Modified: trunk/target/device/geni586/Config.in =================================================================== --- trunk/target/device/geni586/Config.in 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/target/device/geni586/Config.in 2007-02-23 19:44:32 UTC (rev 651) @@ -14,6 +14,14 @@ help Serial console with your i586 - 19200 8n1 +config BR2_TARGET_RT + bool "RT PREEMPT for geni586" + depends BR2_TARGET_GENI586 + default n + help + RT PREEMPT support for geni586- + http://rt.wiki.kernel.org + config BR2_PACKAGE_LINUX bool "linux" depends on BR2_TARGET_GENI586 Deleted: trunk/target/device/geni586/kernel-patches/linux-multi-routes-2.6.19.patch =================================================================== --- trunk/target/device/geni586/kernel-patches/linux-multi-routes-2.6.19.patch 2007-02-23 19:39:22 UTC (rev 650) +++ trunk/target/device/geni586/kernel-patches/linux-multi-routes-2.6.19.patch 2007-02-23 19:44:32 UTC (rev 651) @@ -1,1232 +0,0 @@ -diff -urp v2.6.19/linux/include/linux/netfilter_ipv4/ip_nat.h linux/include/linux/netfilter_ipv4/ip_nat.h ---- v2.6.19/linux/include/linux/netfilter_ipv4/ip_nat.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/include/linux/netfilter_ipv4/ip_nat.h 2007-01-23 23:43:10.000000000 +0200 -@@ -63,6 +63,13 @@ struct ip_nat_info - - struct ip_conntrack; - -+/* Call input routing for SNAT-ed traffic */ -+extern unsigned int ip_nat_route_input(unsigned int hooknum, -+ struct sk_buff **pskb, -+ const struct net_device *in, -+ const struct net_device *out, -+ int (*okfn)(struct sk_buff *)); -+ - /* Set up the info structure to map into this range. */ - extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack, - const struct ip_nat_range *range, -diff -urp v2.6.19/linux/include/linux/rtnetlink.h linux/include/linux/rtnetlink.h ---- v2.6.19/linux/include/linux/rtnetlink.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/include/linux/rtnetlink.h 2007-01-23 23:43:10.000000000 +0200 -@@ -293,6 +293,8 @@ struct rtnexthop - #define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ - #define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ - #define RTNH_F_ONLINK 4 /* Gateway is forced on link */ -+#define RTNH_F_SUSPECT 8 /* We don't know the real state */ -+#define RTNH_F_BADSTATE (RTNH_F_DEAD | RTNH_F_SUSPECT) - - /* Macros to handle hexthops */ - -diff -urp v2.6.19/linux/include/net/flow.h linux/include/net/flow.h ---- v2.6.19/linux/include/net/flow.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/include/net/flow.h 2007-01-23 23:43:10.000000000 +0200 -@@ -19,6 +19,8 @@ struct flowi { - __be32 daddr; - __be32 saddr; - __u32 fwmark; -+ __be32 lsrc; -+ __be32 gw; - __u8 tos; - __u8 scope; - } ip4_u; -@@ -48,6 +50,8 @@ struct flowi { - #define fl4_dst nl_u.ip4_u.daddr - #define fl4_src nl_u.ip4_u.saddr - #define fl4_fwmark nl_u.ip4_u.fwmark -+#define fl4_lsrc nl_u.ip4_u.lsrc -+#define fl4_gw nl_u.ip4_u.gw - #define fl4_tos nl_u.ip4_u.tos - #define fl4_scope nl_u.ip4_u.scope - -diff -urp v2.6.19/linux/include/net/ip_fib.h linux/include/net/ip_fib.h ---- v2.6.19/linux/include/net/ip_fib.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/include/net/ip_fib.h 2007-01-23 23:43:10.000000000 +0200 -@@ -196,7 +196,8 @@ static inline int fib_lookup(const struc - - static inline void fib_select_default(const struct flowi *flp, struct fib_result *res) - { -- if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) -+ if ((FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) || -+ FIB_RES_NH(*res).nh_scope == RT_SCOPE_HOST) - ip_fib_main_table->tb_select_default(ip_fib_main_table, flp, res); - } - -@@ -209,6 +210,7 @@ extern int fib_lookup(struct flowi *flp, - extern struct fib_table *fib_new_table(u32 id); - extern struct fib_table *fib_get_table(u32 id); - extern void fib_select_default(const struct flowi *flp, struct fib_result *res); -+extern int fib_result_table(struct fib_result *res); - - #endif /* CONFIG_IP_MULTIPLE_TABLES */ - -@@ -284,4 +286,6 @@ extern int fib_proc_init(void); - extern void fib_proc_exit(void); - #endif - -+extern rwlock_t fib_nhflags_lock; -+ - #endif /* _NET_FIB_H */ -diff -urp v2.6.19/linux/include/net/route.h linux/include/net/route.h ---- v2.6.19/linux/include/net/route.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/include/net/route.h 2007-01-23 23:43:10.000000000 +0200 -@@ -117,6 +117,7 @@ extern int __ip_route_output_key(struct - extern int ip_route_output_key(struct rtable **, struct flowi *flp); - extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); - extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); -+extern int ip_route_input_lookup(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin, __be32 lsrc); - extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); - extern void ip_rt_send_redirect(struct sk_buff *skb); - -diff -urp v2.6.19/linux/net/ipv4/fib_frontend.c linux/net/ipv4/fib_frontend.c ---- v2.6.19/linux/net/ipv4/fib_frontend.c 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/fib_frontend.c 2007-01-23 23:43:10.000000000 +0200 -@@ -58,8 +58,12 @@ struct fib_table *ip_fib_main_table; - #define FIB_TABLE_HASHSZ 1 - static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; - -+#define FIB_RES_TABLE(r) (RT_TABLE_MAIN) -+ - #else - -+#define FIB_RES_TABLE(r) (fib_result_table(r)) -+ - #define FIB_TABLE_HASHSZ 256 - static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; - -@@ -190,6 +194,9 @@ int fib_validate_source(__be32 src, __be - .tos = tos } }, - .iif = oif }; - struct fib_result res; -+ int table; -+ unsigned char prefixlen; -+ unsigned char scope; - int no_addr, rpf; - int ret; - -@@ -211,31 +218,35 @@ int fib_validate_source(__be32 src, __be - goto e_inval_res; - *spec_dst = FIB_RES_PREFSRC(res); - fib_combine_itag(itag, &res); --#ifdef CONFIG_IP_ROUTE_MULTIPATH -- if (FIB_RES_DEV(res) == dev || res.fi->fib_nhs > 1) --#else - if (FIB_RES_DEV(res) == dev) --#endif - { - ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST; - fib_res_put(&res); - return ret; - } -+ table = FIB_RES_TABLE(&res); -+ prefixlen = res.prefixlen; -+ scope = res.scope; - fib_res_put(&res); - if (no_addr) - goto last_resort; -- if (rpf) -- goto e_inval; - fl.oif = dev->ifindex; - - ret = 0; - if (fib_lookup(&fl, &res) == 0) { -- if (res.type == RTN_UNICAST) { -+ if (res.type == RTN_UNICAST && -+ ((table == FIB_RES_TABLE(&res) && -+ res.prefixlen >= prefixlen && res.scope >= scope) || -+ !rpf)) { - *spec_dst = FIB_RES_PREFSRC(res); - ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST; -+ fib_res_put(&res); -+ return ret; - } - fib_res_put(&res); - } -+ if (rpf) -+ goto e_inval; - return ret; - - last_resort: -@@ -836,9 +847,7 @@ static int fib_inetaddr_event(struct not - switch (event) { - case NETDEV_UP: - fib_add_ifaddr(ifa); --#ifdef CONFIG_IP_ROUTE_MULTIPATH - fib_sync_up(ifa->ifa_dev->dev); --#endif - rt_cache_flush(-1); - break; - case NETDEV_DOWN: -@@ -874,9 +883,7 @@ static int fib_netdev_event(struct notif - for_ifa(in_dev) { - fib_add_ifaddr(ifa); - } endfor_ifa(in_dev); --#ifdef CONFIG_IP_ROUTE_MULTIPATH - fib_sync_up(dev); --#endif - rt_cache_flush(-1); - break; - case NETDEV_DOWN: -diff -urp v2.6.19/linux/net/ipv4/fib_hash.c linux/net/ipv4/fib_hash.c ---- v2.6.19/linux/net/ipv4/fib_hash.c 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/fib_hash.c 2007-01-23 23:43:10.000000000 +0200 -@@ -275,30 +275,38 @@ out: - return err; - } - --static int fn_hash_last_dflt=-1; -- - static void - fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) - { -- int order, last_idx; -+ int order, last_idx, last_dflt, last_nhsel; -+ struct fib_alias *first_fa = NULL; -+ struct hlist_head *head; - struct hlist_node *node; - struct fib_node *f; - struct fib_info *fi = NULL; - struct fib_info *last_resort; - struct fn_hash *t = (struct fn_hash*)tb->tb_data; -- struct fn_zone *fz = t->fn_zones[0]; -+ struct fn_zone *fz = t->fn_zones[res->prefixlen]; -+ __be32 k; - - if (fz == NULL) - return; - -+ k = fz_key(flp->fl4_dst, fz); -+ last_dflt = -2; -+ last_nhsel = 0; - last_idx = -1; - last_resort = NULL; - order = -1; - - read_lock(&fib_hash_lock); -- hlist_for_each_entry(f, node, &fz->fz_hash[0], fn_hash) { -+ head = &fz->fz_hash[fn_hash(k, fz)]; -+ hlist_for_each_entry(f, node, head, fn_hash) { - struct fib_alias *fa; - -+ if (f->fn_key != k) -+ continue; -+ - list_for_each_entry(fa, &f->fn_alias, fa_list) { - struct fib_info *next_fi = fa->fa_info; - -@@ -306,41 +314,52 @@ fn_hash_select_default(struct fib_table - fa->fa_type != RTN_UNICAST) - continue; - -+ if (fa->fa_tos && -+ fa->fa_tos != flp->fl4_tos) -+ continue; - if (next_fi->fib_priority > res->fi->fib_priority) - break; -- if (!next_fi->fib_nh[0].nh_gw || -- next_fi->fib_nh[0].nh_scope != RT_SCOPE_LINK) -- continue; - fa->fa_state |= FA_S_ACCESSED; - -- if (fi == NULL) { -- if (next_fi != res->fi) -- break; -- } else if (!fib_detect_death(fi, order, &last_resort, -- &last_idx, &fn_hash_last_dflt)) { -+ if (!first_fa) { -+ last_dflt = fa->fa_last_dflt; -+ first_fa = fa; -+ } -+ if (fi && !fib_detect_death(fi, order, &last_resort, -+ &last_idx, &last_dflt, &last_nhsel, flp)) { - if (res->fi) - fib_info_put(res->fi); - res->fi = fi; - atomic_inc(&fi->fib_clntref); -- fn_hash_last_dflt = order; -+ first_fa->fa_last_dflt = order; - goto out; - } - fi = next_fi; - order++; - } -+ break; - } - - if (order <= 0 || fi == NULL) { -- fn_hash_last_dflt = -1; -+ if (fi && fi->fib_nhs > 1 && -+ fib_detect_death(fi, order, &last_resort, &last_idx, -+ &last_dflt, &last_nhsel, flp) && -+ last_resort == fi) { -+ read_lock_bh(&fib_nhflags_lock); -+ fi->fib_nh[last_nhsel].nh_flags &= ~RTNH_F_SUSPECT; -+ read_unlock_bh(&fib_nhflags_lock); -+ } -+ if (first_fa) first_fa->fa_last_dflt = -1; - goto out; - } - -- if (!fib_detect_death(fi, order, &last_resort, &last_idx, &fn_hash_last_dflt)) { -+ if (!fib_detect_death(fi, order, &last_resort, &last_idx, -+ &last_dflt, &last_nhsel, flp)) { - if (res->fi) - fib_info_put(res->fi); - res->fi = fi; - atomic_inc(&fi->fib_clntref); -- fn_hash_last_dflt = order; -+ first_fa->fa_last_dflt = order; - goto out; - } - -@@ -350,8 +369,11 @@ fn_hash_select_default(struct fib_table - res->fi = last_resort; - if (last_resort) - atomic_inc(&last_resort->fib_clntref); -+ read_lock_bh(&fib_nhflags_lock); -+ last_resort->fib_nh[last_nhsel].nh_flags &= ~RTNH_F_SUSPECT; -+ read_unlock_bh(&fib_nhflags_lock); -+ first_fa->fa_last_dflt = last_idx; - } -- fn_hash_last_dflt = last_idx; - out: - read_unlock(&fib_hash_lock); - } -@@ -447,6 +469,7 @@ static int fn_hash_insert(struct fib_tab - write_lock_bh(&fib_hash_lock); - fi_drop = fa->fa_info; - fa->fa_info = fi; -+ fa->fa_last_dflt = -1; - fa->fa_type = cfg->fc_type; - fa->fa_scope = cfg->fc_scope; - state = fa->fa_state; -@@ -506,6 +529,7 @@ static int fn_hash_insert(struct fib_tab - new_fa->fa_type = cfg->fc_type; - new_fa->fa_scope = cfg->fc_scope; - new_fa->fa_state = 0; -+ new_fa->fa_last_dflt = -1; - - /* - * Insert new entry to the list. -diff -urp v2.6.19/linux/net/ipv4/fib_lookup.h linux/net/ipv4/fib_lookup.h ---- v2.6.19/linux/net/ipv4/fib_lookup.h 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/fib_lookup.h 2007-01-23 23:43:10.000000000 +0200 -@@ -9,6 +9,7 @@ struct fib_alias { - struct list_head fa_list; - struct rcu_head rcu; - struct fib_info *fa_info; -+ int fa_last_dflt; - u8 fa_tos; - u8 fa_type; - u8 fa_scope; -@@ -35,6 +36,7 @@ extern struct fib_alias *fib_find_alias( - u8 tos, u32 prio); - extern int fib_detect_death(struct fib_info *fi, int order, - struct fib_info **last_resort, -- int *last_idx, int *dflt); -+ int *last_idx, int *dflt, int *last_nhsel, -+ const struct flowi *flp); - - #endif /* _FIB_LOOKUP_H */ -diff -urp v2.6.19/linux/net/ipv4/fib_rules.c linux/net/ipv4/fib_rules.c ---- v2.6.19/linux/net/ipv4/fib_rules.c 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/fib_rules.c 2007-01-23 23:43:10.000000000 +0200 -@@ -89,6 +89,11 @@ u32 fib_rules_tclass(struct fib_result * - } - #endif - -+int fib_result_table(struct fib_result *res) -+{ -+ return res->r->table; -+} -+ - int fib_lookup(struct flowi *flp, struct fib_result *res) - { - struct fib_lookup_arg arg = { -@@ -140,7 +145,8 @@ errout: - void fib_select_default(const struct flowi *flp, struct fib_result *res) - { - if (res->r && res->r->action == FR_ACT_TO_TBL && -- FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) { -+ ((FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) || -+ FIB_RES_NH(*res).nh_scope == RT_SCOPE_HOST)) { - struct fib_table *tb; - if ((tb = fib_get_table(res->r->table)) != NULL) - tb->tb_select_default(tb, flp, res); -diff -urp v2.6.19/linux/net/ipv4/fib_semantics.c linux/net/ipv4/fib_semantics.c ---- v2.6.19/linux/net/ipv4/fib_semantics.c 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/fib_semantics.c 2007-01-23 23:43:10.000000000 +0200 -@@ -55,6 +55,7 @@ static struct hlist_head *fib_info_hash; - static struct hlist_head *fib_info_laddrhash; - static unsigned int fib_hash_size; - static unsigned int fib_info_cnt; -+rwlock_t fib_nhflags_lock = RW_LOCK_UNLOCKED; - - #define DEVINDEX_HASHBITS 8 - #define DEVINDEX_HASHSIZE (1U << DEVINDEX_HASHBITS) -@@ -190,7 +191,7 @@ static __inline__ int nh_comp(const stru - #ifdef CONFIG_NET_CLS_ROUTE - nh->nh_tclassid != onh->nh_tclassid || - #endif -- ((nh->nh_flags^onh->nh_flags)&~RTNH_F_DEAD)) -+ ((nh->nh_flags^onh->nh_flags)&~RTNH_F_BADSTATE)) - return -1; - onh++; - } endfor_nexthops(fi); -@@ -227,7 +228,7 @@ static struct fib_info *fib_find_info(co - nfi->fib_priority == fi->fib_priority && - memcmp(nfi->fib_metrics, fi->fib_metrics, - sizeof(fi->fib_metrics)) == 0 && -- ((nfi->fib_flags^fi->fib_flags)&~RTNH_F_DEAD) == 0 && -+ ((nfi->fib_flags^fi->fib_flags)&~RTNH_F_BADSTATE) == 0 && - (nfi->fib_nhs == 0 || nh_comp(fi, nfi) == 0)) - return fi; - } -@@ -319,26 +320,70 @@ struct fib_alias *fib_find_alias(struct - } - - int fib_detect_death(struct fib_info *fi, int order, -- struct fib_info **last_resort, int *last_idx, int *dflt) -+ struct fib_info **last_resort, int *last_idx, int *dflt, -+ int *last_nhsel, const struct flowi *flp) - { - struct neighbour *n; -- int state = NUD_NONE; -+ int nhsel; -+ int state; -+ struct fib_nh * nh; -+ __be32 dst; -+ int flag, dead = 1; -+ -+ /* change_nexthops(fi) { */ -+ for (nhsel = 0, nh = fi->fib_nh; nhsel < fi->fib_nhs; nh++, nhsel++) { -+ if (flp->oif && flp->oif != nh->nh_oif) -+ continue; -+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw && nh->nh_gw && -+ nh->nh_scope == RT_SCOPE_LINK) -+ continue; -+ if (nh->nh_flags & RTNH_F_DEAD) -+ continue; - -- n = neigh_lookup(&arp_tbl, &fi->fib_nh[0].nh_gw, fi->fib_dev); -- if (n) { -- state = n->nud_state; -- neigh_release(n); -- } -- if (state==NUD_REACHABLE) -- return 0; -- if ((state&NUD_VALID) && order != *dflt) -- return 0; -- if ((state&NUD_VALID) || -- (*last_idx<0 && order > *dflt)) { -- *last_resort = fi; -- *last_idx = order; -+ flag = 0; -+ if (nh->nh_dev->flags & IFF_NOARP) { -+ dead = 0; -+ goto setfl; -+ } -+ -+ dst = nh->nh_gw; -+ if (!nh->nh_gw || nh->nh_scope != RT_SCOPE_LINK) -+ dst = flp->fl4_dst; -+ -+ state = NUD_NONE; -+ n = neigh_lookup(&arp_tbl, &dst, nh->nh_dev); -+ if (n) { -+ state = n->nud_state; -+ neigh_release(n); -+ } -+ if (state==NUD_REACHABLE || -+ ((state&NUD_VALID) && order != *dflt)) { -+ dead = 0; -+ goto setfl; -+ } -+ if (!(state&NUD_VALID)) -+ flag = 1; -+ if (!dead) -+ goto setfl; -+ if ((state&NUD_VALID) || -+ (*last_idx<0 && order >= *dflt)) { -+ *last_resort = fi; -+ *last_idx = order; -+ *last_nhsel = nhsel; -+ } -+ -+ setfl: -+ -+ read_lock_bh(&fib_nhflags_lock); -+ if (flag) -+ nh->nh_flags |= RTNH_F_SUSPECT; -+ else -+ nh->nh_flags &= ~RTNH_F_SUSPECT; -+ read_unlock_bh(&fib_nhflags_lock); - } -- return 1; -+ /* } endfor_nexthops(fi) */ -+ -+ return dead; - } - - #ifdef CONFIG_IP_ROUTE_MULTIPATH -@@ -508,8 +553,11 @@ static int fib_check_nh(struct fib_confi - return -EINVAL; - if ((dev = __dev_get_by_index(nh->nh_oif)) == NULL) - return -ENODEV; -- if (!(dev->flags&IFF_UP)) -- return -ENETDOWN; -+ if (!(dev->flags&IFF_UP)) { -+ if (fi->fib_protocol != RTPROT_STATIC) -+ return -ENETDOWN; -+ nh->nh_flags |= RTNH_F_DEAD; -+ } - nh->nh_dev = dev; - dev_hold(dev); - nh->nh_scope = RT_SCOPE_LINK; -@@ -529,24 +577,48 @@ static int fib_check_nh(struct fib_confi - /* It is not necessary, but requires a bit of thinking */ - if (fl.fl4_scope < RT_SCOPE_LINK) - fl.fl4_scope = RT_SCOPE_LINK; -- if ((err = fib_lookup(&fl, &res)) != 0) -- return err; -+ err = fib_lookup(&fl, &res); - } -- err = -EINVAL; -- if (res.type != RTN_UNICAST && res.type != RTN_LOCAL) -- goto out; -- nh->nh_scope = res.scope; -- nh->nh_oif = FIB_RES_OIF(res); -- if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL) -- goto out; -- dev_hold(nh->nh_dev); -- err = -ENETDOWN; -- if (!(nh->nh_dev->flags & IFF_UP)) -- goto out; -- err = 0; -+ if (err) { -+ struct in_device *in_dev; -+ -+ if (err != -ENETUNREACH || -+ fi->fib_protocol != RTPROT_STATIC) -+ return err; -+ -+ in_dev = inetdev_by_index(nh->nh_oif); -+ if (in_dev == NULL || -+ in_dev->dev->flags & IFF_UP) { -+ if (in_dev) -+ in_dev_put(in_dev); -+ return err; -+ } -+ nh->nh_flags |= RTNH_F_DEAD; -+ nh->nh_scope = RT_SCOPE_LINK; -+ nh->nh_dev = in_dev->dev; -+ dev_hold(nh->nh_dev); -+ in_dev_put(in_dev); -+ } else { -+ err = -EINVAL; -+ if (res.type != RTN_UNICAST && res.type != RTN_LOCAL) -+ goto out; -+ nh->nh_scope = res.scope; -+ nh->nh_oif = FIB_RES_OIF(res); -+ if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL) -+ goto out; -+ dev_hold(nh->nh_dev); -+ if (!(nh->nh_dev->flags & IFF_UP)) { -+ if (fi->fib_protocol != RTPROT_STATIC) { -+ err = -ENETDOWN; -+ goto out; -+ } -+ nh->nh_flags |= RTNH_F_DEAD; -+ } -+ err = 0; - out: -- fib_res_put(&res); -- return err; -+ fib_res_put(&res); -+ return err; -+ } - } else { - struct in_device *in_dev; - -@@ -557,8 +629,11 @@ out: - if (in_dev == NULL) - return -ENODEV; - if (!(in_dev->dev->flags&IFF_UP)) { -- in_dev_put(in_dev); -- return -ENETDOWN; -+ if (fi->fib_protocol != RTPROT_STATIC) { -+ in_dev_put(in_dev); -+ return -ENETDOWN; -+ } -+ nh->nh_flags |= RTNH_F_DEAD; - } - nh->nh_dev = in_dev->dev; - dev_hold(nh->nh_dev); -@@ -881,8 +956,12 @@ int fib_semantic_match(struct list_head - for_nexthops(fi) { - if (nh->nh_flags&RTNH_F_DEAD) - continue; -- if (!flp->oif || flp->oif == nh->nh_oif) -- break; -+ if (flp->oif && flp->oif != nh->nh_oif) -+ continue; -+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw && -+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK) -+ continue; -+ break; - } - #ifdef CONFIG_IP_ROUTE_MULTIPATH - if (nhsel < fi->fib_nhs) { -@@ -1056,18 +1135,29 @@ int fib_sync_down(__be32 local, struct n - prev_fi = fi; - dead = 0; - change_nexthops(fi) { -- if (nh->nh_flags&RTNH_F_DEAD) -- dead++; -- else if (nh->nh_dev == dev && -- nh->nh_scope != scope) { -- nh->nh_flags |= RTNH_F_DEAD; -+ if (nh->nh_flags&RTNH_F_DEAD) { -+ if (fi->fib_protocol!=RTPROT_STATIC || -+ nh->nh_dev == NULL || -+ __in_dev_get_rtnl(nh->nh_dev) == NULL || -+ nh->nh_dev->flags&IFF_UP) -+ dead++; -+ } else if (nh->nh_dev == dev && -+ nh->nh_scope != scope) { -+ write_lock_bh(&fib_nhflags_lock); - #ifdef CONFIG_IP_ROUTE_MULTIPATH -- spin_lock_bh(&fib_multipath_lock); -+ spin_lock(&fib_multipath_lock); -+ nh->nh_flags |= RTNH_F_DEAD; - fi->fib_power -= nh->nh_power; - nh->nh_power = 0; -- spin_unlock_bh(&fib_multipath_lock); -+ spin_unlock(&fib_multipath_lock); -+#else -+ nh->nh_flags |= RTNH_F_DEAD; - #endif -- dead++; -+ write_unlock_bh(&fib_nhflags_lock); -+ if (fi->fib_protocol!=RTPROT_STATIC || -+ force || -+ __in_dev_get_rtnl(dev) == NULL) -+ dead++; - } - #ifdef CONFIG_IP_ROUTE_MULTIPATH - if (force > 1 && nh->nh_dev == dev) { -@@ -1086,11 +1176,8 @@ int fib_sync_down(__be32 local, struct n - return ret; - } - --#ifdef CONFIG_IP_ROUTE_MULTIPATH -- - /* -- Dead device goes up. We wake up dead nexthops. -- It takes sense only on multipath routes. -+ Dead device goes up or new address is added. We wake up dead nexthops. - */ - - int fib_sync_up(struct net_device *dev) -@@ -1100,8 +1187,10 @@ int fib_sync_up(struct net_device *dev) - struct hlist_head *head; - struct hlist_node *node; - struct fib_nh *nh; -- int ret; -+ struct fib_result res; -+ int ret, rep; - -+repeat: - if (!(dev->flags&IFF_UP)) - return 0; - -@@ -1109,6 +1198,7 @@ int fib_sync_up(struct net_device *dev) - hash = fib_devindex_hashfn(dev->ifindex); - head = &fib_info_devhash[hash]; - ret = 0; -+ rep = 0; - - hlist_for_each_entry(nh, node, head, nh_hash) { - struct fib_info *fi = nh->nh_parent; -@@ -1121,19 +1211,37 @@ int fib_sync_up(struct net_device *dev) - prev_fi = fi; - alive = 0; - change_nexthops(fi) { -- if (!(nh->nh_flags&RTNH_F_DEAD)) { -- alive++; -+ if (!(nh->nh_flags&RTNH_F_DEAD)) - continue; -- } - if (nh->nh_dev == NULL || !(nh->nh_dev->flags&IFF_UP)) - continue; - if (nh->nh_dev != dev || !__in_dev_get_rtnl(dev)) - continue; -+ if (nh->nh_gw && fi->fib_protocol == RTPROT_STATIC) { -+ struct flowi fl = { -+ .nl_u = { .ip4_u = -+ { .daddr = nh->nh_gw, -+ .scope = nh->nh_scope } }, -+ .oif = nh->nh_oif, -+ }; -+ if (fib_lookup(&fl, &res) != 0) -+ continue; -+ if (res.type != RTN_UNICAST && -+ res.type != RTN_LOCAL) { -+ fib_res_put(&res); -+ continue; -+ } -+ nh->nh_scope = res.scope; -+ fib_res_put(&res); -+ rep = 1; -+ } - alive++; -+#ifdef CONFIG_IP_ROUTE_MULTIPATH - spin_lock_bh(&fib_multipath_lock); - nh->nh_power = 0; - nh->nh_flags &= ~RTNH_F_DEAD; - spin_unlock_bh(&fib_multipath_lock); -+#endif - } endfor_nexthops(fi) - - if (alive > 0) { -@@ -1141,10 +1249,14 @@ int fib_sync_up(struct net_device *dev) - ret++; - } - } -+ if (rep) -+ goto repeat; - - return ret; - } - -+#ifdef CONFIG_IP_ROUTE_MULTIPATH -+ - /* - The algorithm is suboptimal, but it provides really - fair weighted route distribution. -@@ -1153,24 +1265,45 @@ int fib_sync_up(struct net_device *dev) - void fib_select_multipath(const struct flowi *flp, struct fib_result *res) - { - struct fib_info *fi = res->fi; -- int w; -+ int w, alive; - - spin_lock_bh(&fib_multipath_lock); -+ if (flp->oif) { -+ int sel = -1; -+ w = -1; -+ change_nexthops(fi) { -+ if (flp->oif != nh->nh_oif) -+ continue; -+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw && -+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK) -+ continue; -+ if (!(nh->nh_flags&RTNH_F_BADSTATE)) { -+ if (nh->nh_power > w) { -+ w = nh->nh_power; -+ sel = nhsel; -+ } -+ } -+ } endfor_nexthops(fi); -+ if (sel >= 0) { -+ spin_unlock_bh(&fib_multipath_lock); -+ res->nh_sel = sel; -+ return; -+ } -+ goto last_resort; -+ } -+ -+repeat: - if (fi->fib_power <= 0) { - int power = 0; - change_nexthops(fi) { -- if (!(nh->nh_flags&RTNH_F_DEAD)) { -+ if (!(nh->nh_flags&RTNH_F_BADSTATE)) { - power += nh->nh_weight; - nh->nh_power = nh->nh_weight; - } - } endfor_nexthops(fi); - fi->fib_power = power; -- if (power <= 0) { -- spin_unlock_bh(&fib_multipath_lock); -- /* Race condition: route has just become dead. */ -- res->nh_sel = 0; -- return; -- } -+ if (power <= 0) -+ goto last_resort; - } - - -@@ -1180,20 +1313,40 @@ void fib_select_multipath(const struct f - - w = jiffies % fi->fib_power; - -+ alive = 0; - change_nexthops(fi) { -- if (!(nh->nh_flags&RTNH_F_DEAD) && nh->nh_power) { -+ if (!(nh->nh_flags&RTNH_F_BADSTATE) && nh->nh_power) { - if ((w -= nh->nh_power) <= 0) { - nh->nh_power--; - fi->fib_power--; -- res->nh_sel = nhsel; - spin_unlock_bh(&fib_multipath_lock); -+ res->nh_sel = nhsel; - return; - } -+ alive = 1; -+ } -+ } endfor_nexthops(fi); -+ if (alive) { -+ fi->fib_power = 0; -+ goto repeat; -+ } -+ -+last_resort: -+ -+ for_nexthops(fi) { -+ if (!(nh->nh_flags&RTNH_F_DEAD)) { -+ if (flp->oif && flp->oif != nh->nh_oif) -+ continue; -+ if (flp->fl4_gw && flp->fl4_gw != nh->nh_gw && -+ nh->nh_gw && nh->nh_scope == RT_SCOPE_LINK) -+ continue; -+ spin_unlock_bh(&fib_multipath_lock); -+ res->nh_sel = nhsel; -+ return; - } - } endfor_nexthops(fi); - - /* Race condition: route has just become dead. */ -- res->nh_sel = 0; - spin_unlock_bh(&fib_multipath_lock); - } - #endif -diff -urp v2.6.19/linux/net/ipv4/netfilter/ip_nat_core.c linux/net/ipv4/netfilter/ip_nat_core.c ---- v2.6.19/linux/net/ipv4/netfilter/ip_nat_core.c 2006-12-01 00:26:11.000000000 +0200 -+++ linux/net/ipv4/netfilter/ip_nat_core.c 2007-01-23 23:43:10.000000000 +0200 -@@ -573,6 +573,53 @@ EXPORT_SYMBOL_GPL(ip_nat_port_nfattr_to_ - EXPORT_SYMBOL_GPL(ip_nat_port_range_to_nfattr); - #endif - -+unsigned int -+ip_nat_route_input(unsigned int hooknum, -+ struct sk_buff **pskb, -+ const struct net_device *in, -+ const struct net_device *out, -+ int (*okfn)(struct sk_buff *)) -+{ -+ struct sk_buff *skb = *pskb; -+ struct iphdr *iph; -+ struct ip_conntrack *conn; -+ enum ip_conntrack_info ctinfo; -+ enum ip_conntrack_dir dir; -+ unsigned long statusbit; -+ __be32 saddr; -+ -+ if (!(conn = ip_conntrack_get(skb, &ctinfo))) -+ return NF_ACCEPT; -+ -+ if (!(conn->status & IPS_NAT_DONE_MASK)) -+ return NF_ACCEPT; -+ dir = CTINFO2DIR(ctinfo); -+ statusbit = IPS_SRC_NAT; -+ if (dir == IP_CT_DIR_REPLY) -+ ... [truncated message content] |