devik
--------
diff -ru linux/net/ipv4/ip_masq.c gate2/net/ipv4/ip_masq.c
--- linux/net/ipv4/ip_masq.c Sun Mar 25 18:37:41 2001
+++ gate2/net/ipv4/ip_masq.c Tue Jul 24 20:05:21 2001
@@ -50,6 +50,7 @@
* Kai Bankett : do not toss other IP protos in proto_doff()
* Dan Kegel : pointed correct NAT behavior for UDP streams
* Julian Anastasov : use daddr and dport as hash keys
+ * Martin Devera : extended sysctl_ip_dynaddr functionality
*
*/
@@ -1236,9 +1237,9 @@
* in this tunnel and routing iface address has changed...
* "You are welcome, diald".
*/
- if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && maddr != ms->maddr) {
-
- if (sysctl_ip_dynaddr > 1) {
+ if ( sysctl_ip_dynaddr && (sysctl_ip_dynaddr & 4 ||
+ ms->flags & IP_MASQ_F_NO_REPLY) && maddr != ms->maddr) {
+ if ((sysctl_ip_dynaddr & 3) > 1) {
IP_MASQ_INFO( "ip_fw_masquerade(): change masq.addr from %d.%d.%d.%d to %d.%d.%d.%d\n",
NIPQUAD(ms->maddr),NIPQUAD(maddr));
}
@@ -1527,9 +1528,9 @@
* in this tunnel and routing iface address has changed...
* "You are welcome, diald".
*/
- if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && maddr != ms->maddr) {
-
- if (sysctl_ip_dynaddr > 1) {
+ if ( sysctl_ip_dynaddr && (sysctl_ip_dynaddr & 4 ||
+ ms->flags & IP_MASQ_F_NO_REPLY) && maddr != ms->maddr) {
+ if ((sysctl_ip_dynaddr & 3) > 1) {
IP_MASQ_INFO( "ip_fw_masq_icmp(): change masq.addr %d.%d.%d.%d to %d.%d.%d.%d",
NIPQUAD(ms->maddr), NIPQUAD(maddr));
}
diff -ru linux/net/ipv4/tcp_ipv4.c gate2/net/ipv4/tcp_ipv4.c
--- linux/net/ipv4/tcp_ipv4.c Sun Mar 25 18:37:41 2001
+++ gate2/net/ipv4/tcp_ipv4.c Tue Jul 24 20:12:06 2001
@@ -1889,7 +1889,7 @@
}
if (new_saddr != sk->saddr) {
- if (sysctl_ip_dynaddr > 1) {
+ if ((sysctl_ip_dynaddr & 3) > 1) {
printk(KERN_INFO "tcp_v4_rebuild_header(): shifting sk->saddr "
"from %d.%d.%d.%d to %d.%d.%d.%d\n",
NIPQUAD(sk->saddr),
--- linux/Documentation/networking/ip_dynaddr.txt Sun Mar 25 18:31:57 2001
+++ gate2/Documentation/networking/ip_dynaddr.txt Tue Jul 24 20:44:42 2001
@@ -23,6 +23,12 @@
# echo 2 > /proc/sys/net/ipv4/ip_dynaddr
To disable (default)
# echo 0 > /proc/sys/net/ipv4/ip_dynaddr
+ To always rewrite MASQ connections instead only when no reply
+ packet is recieved (needed to be able to change routing, for
+ example when doing backup-line) add 4 to flag, like:
+ # echo 5 > /proc/sys/net/ipv4/ip_dynaddr
+ or
+ # echo 6 > /proc/sys/net/ipv4/ip_dynaddr
Enjoy!
---------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/