diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/pktgen.c | 2 | ||||
| -rw-r--r-- | net/core/sock.c | 13 | ||||
| -rw-r--r-- | net/core/utils.c | 37 | ||||
| -rw-r--r-- | net/ipv4/Kconfig | 2 | ||||
| -rw-r--r-- | net/ipv4/Makefile | 2 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_conntrack_core.c | 2 | ||||
| -rw-r--r-- | net/ipv4/utils.c | 59 | ||||
| -rw-r--r-- | net/ipv6/ip6_output.c | 7 |
8 files changed, 48 insertions, 76 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 975d651312dc..8eb083b6041a 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -363,7 +363,7 @@ struct pktgen_thread { | |||
| 363 | * All Rights Reserved. | 363 | * All Rights Reserved. |
| 364 | * | 364 | * |
| 365 | */ | 365 | */ |
| 366 | inline static s64 divremdi3(s64 x, s64 y, int type) | 366 | static inline s64 divremdi3(s64 x, s64 y, int type) |
| 367 | { | 367 | { |
| 368 | u64 a = (x < 0) ? -x : x; | 368 | u64 a = (x < 0) ? -x : x; |
| 369 | u64 b = (y < 0) ? -y : y; | 369 | u64 b = (y < 0) ? -y : y; |
diff --git a/net/core/sock.c b/net/core/sock.c index 8b35ccdc2b3b..12f6d9a2a522 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock, int level, int optname, | |||
| 206 | */ | 206 | */ |
| 207 | 207 | ||
| 208 | #ifdef SO_DONTLINGER /* Compatibility item... */ | 208 | #ifdef SO_DONTLINGER /* Compatibility item... */ |
| 209 | switch (optname) { | 209 | if (optname == SO_DONTLINGER) { |
| 210 | case SO_DONTLINGER: | 210 | lock_sock(sk); |
| 211 | sock_reset_flag(sk, SOCK_LINGER); | 211 | sock_reset_flag(sk, SOCK_LINGER); |
| 212 | return 0; | 212 | release_sock(sk); |
| 213 | return 0; | ||
| 213 | } | 214 | } |
| 214 | #endif | 215 | #endif |
| 215 | 216 | ||
| 216 | if(optlen<sizeof(int)) | 217 | if(optlen<sizeof(int)) |
| 217 | return(-EINVAL); | 218 | return(-EINVAL); |
| 218 | 219 | ||
diff --git a/net/core/utils.c b/net/core/utils.c index e11a8654f363..88eb8b68e26b 100644 --- a/net/core/utils.c +++ b/net/core/utils.c | |||
| @@ -23,10 +23,10 @@ | |||
| 23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
| 24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 25 | 25 | ||
| 26 | #include <asm/byteorder.h> | ||
| 26 | #include <asm/system.h> | 27 | #include <asm/system.h> |
| 27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
| 28 | 29 | ||
| 29 | |||
| 30 | /* | 30 | /* |
| 31 | This is a maximally equidistributed combined Tausworthe generator | 31 | This is a maximally equidistributed combined Tausworthe generator |
| 32 | based on code from GNU Scientific Library 1.5 (30 Jun 2004) | 32 | based on code from GNU Scientific Library 1.5 (30 Jun 2004) |
| @@ -153,3 +153,38 @@ int net_ratelimit(void) | |||
| 153 | EXPORT_SYMBOL(net_random); | 153 | EXPORT_SYMBOL(net_random); |
| 154 | EXPORT_SYMBOL(net_ratelimit); | 154 | EXPORT_SYMBOL(net_ratelimit); |
| 155 | EXPORT_SYMBOL(net_srandom); | 155 | EXPORT_SYMBOL(net_srandom); |
| 156 | |||
| 157 | /* | ||
| 158 | * Convert an ASCII string to binary IP. | ||
| 159 | * This is outside of net/ipv4/ because various code that uses IP addresses | ||
| 160 | * is otherwise not dependent on the TCP/IP stack. | ||
| 161 | */ | ||
| 162 | |||
| 163 | __u32 in_aton(const char *str) | ||
| 164 | { | ||
| 165 | unsigned long l; | ||
| 166 | unsigned int val; | ||
| 167 | int i; | ||
| 168 | |||
| 169 | l = 0; | ||
| 170 | for (i = 0; i < 4; i++) | ||
| 171 | { | ||
| 172 | l <<= 8; | ||
| 173 | if (*str != '\0') | ||
| 174 | { | ||
| 175 | val = 0; | ||
| 176 | while (*str != '\0' && *str != '.') | ||
| 177 | { | ||
| 178 | val *= 10; | ||
| 179 | val += *str - '0'; | ||
| 180 | str++; | ||
| 181 | } | ||
| 182 | l |= val; | ||
| 183 | if (*str != '\0') | ||
| 184 | str++; | ||
| 185 | } | ||
| 186 | } | ||
| 187 | return(htonl(l)); | ||
| 188 | } | ||
| 189 | |||
| 190 | EXPORT_SYMBOL(in_aton); | ||
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index fc561c0ae8e2..0b3d9f1d8069 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
| @@ -124,7 +124,7 @@ config IP_ROUTE_MULTIPATH | |||
| 124 | 124 | ||
| 125 | config IP_ROUTE_MULTIPATH_CACHED | 125 | config IP_ROUTE_MULTIPATH_CACHED |
| 126 | bool "IP: equal cost multipath with caching support (EXPERIMENTAL)" | 126 | bool "IP: equal cost multipath with caching support (EXPERIMENTAL)" |
| 127 | depends on: IP_ROUTE_MULTIPATH | 127 | depends on IP_ROUTE_MULTIPATH |
| 128 | help | 128 | help |
| 129 | Normally, equal cost multipath routing is not supported by the | 129 | Normally, equal cost multipath routing is not supported by the |
| 130 | routing cache. If you say Y here, alternative routes are cached | 130 | routing cache. If you say Y here, alternative routes are cached |
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile index 5718cdb3a61e..55dc6cca1e7b 100644 --- a/net/ipv4/Makefile +++ b/net/ipv4/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for the Linux TCP/IP (INET) layer. | 2 | # Makefile for the Linux TCP/IP (INET) layer. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := utils.o route.o inetpeer.o protocol.o \ | 5 | obj-y := route.o inetpeer.o protocol.o \ |
| 6 | ip_input.o ip_fragment.o ip_forward.o ip_options.o \ | 6 | ip_input.o ip_fragment.o ip_forward.o ip_options.o \ |
| 7 | ip_output.o ip_sockglue.o \ | 7 | ip_output.o ip_sockglue.o \ |
| 8 | tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ | 8 | tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ |
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 63bf88264980..86f04e41dd8e 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c | |||
| @@ -510,7 +510,7 @@ init_conntrack(const struct ip_conntrack_tuple *tuple, | |||
| 510 | /* Welcome, Mr. Bond. We've been expecting you... */ | 510 | /* Welcome, Mr. Bond. We've been expecting you... */ |
| 511 | __set_bit(IPS_EXPECTED_BIT, &conntrack->status); | 511 | __set_bit(IPS_EXPECTED_BIT, &conntrack->status); |
| 512 | conntrack->master = exp->master; | 512 | conntrack->master = exp->master; |
| 513 | #if CONFIG_IP_NF_CONNTRACK_MARK | 513 | #ifdef CONFIG_IP_NF_CONNTRACK_MARK |
| 514 | conntrack->mark = exp->master->mark; | 514 | conntrack->mark = exp->master->mark; |
| 515 | #endif | 515 | #endif |
| 516 | nf_conntrack_get(&conntrack->master->ct_general); | 516 | nf_conntrack_get(&conntrack->master->ct_general); |
diff --git a/net/ipv4/utils.c b/net/ipv4/utils.c deleted file mode 100644 index 6aecd7a43534..000000000000 --- a/net/ipv4/utils.c +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * INET An implementation of the TCP/IP protocol suite for the LINUX | ||
| 3 | * operating system. INET is implemented using the BSD Socket | ||
| 4 | * interface as the means of communication with the user level. | ||
| 5 | * | ||
| 6 | * Various kernel-resident INET utility functions; mainly | ||
| 7 | * for format conversion and debugging output. | ||
| 8 | * | ||
| 9 | * Version: $Id: utils.c,v 1.8 2000/10/03 07:29:01 anton Exp $ | ||
| 10 | * | ||
| 11 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | ||
| 12 | * | ||
| 13 | * Fixes: | ||
| 14 | * Alan Cox : verify_area check. | ||
| 15 | * Alan Cox : removed old debugging. | ||
| 16 | * Andi Kleen : add net_ratelimit() | ||
| 17 | * | ||
| 18 | * This program is free software; you can redistribute it and/or | ||
| 19 | * modify it under the terms of the GNU General Public License | ||
| 20 | * as published by the Free Software Foundation; either version | ||
| 21 | * 2 of the License, or (at your option) any later version. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #include <linux/module.h> | ||
| 25 | #include <linux/types.h> | ||
| 26 | #include <asm/byteorder.h> | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Convert an ASCII string to binary IP. | ||
| 30 | */ | ||
| 31 | |||
| 32 | __u32 in_aton(const char *str) | ||
| 33 | { | ||
| 34 | unsigned long l; | ||
| 35 | unsigned int val; | ||
| 36 | int i; | ||
| 37 | |||
| 38 | l = 0; | ||
| 39 | for (i = 0; i < 4; i++) | ||
| 40 | { | ||
| 41 | l <<= 8; | ||
| 42 | if (*str != '\0') | ||
| 43 | { | ||
| 44 | val = 0; | ||
| 45 | while (*str != '\0' && *str != '.') | ||
| 46 | { | ||
| 47 | val *= 10; | ||
| 48 | val += *str - '0'; | ||
| 49 | str++; | ||
| 50 | } | ||
| 51 | l |= val; | ||
| 52 | if (*str != '\0') | ||
| 53 | str++; | ||
| 54 | } | ||
| 55 | } | ||
| 56 | return(htonl(l)); | ||
| 57 | } | ||
| 58 | |||
| 59 | EXPORT_SYMBOL(in_aton); | ||
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 1f2c2f9e353f..ae652ca14bc9 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -792,13 +792,8 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl) | |||
| 792 | if (ipv6_addr_any(&fl->fl6_src)) { | 792 | if (ipv6_addr_any(&fl->fl6_src)) { |
| 793 | err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); | 793 | err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); |
| 794 | 794 | ||
| 795 | if (err) { | 795 | if (err) |
| 796 | #if IP6_DEBUG >= 2 | ||
| 797 | printk(KERN_DEBUG "ip6_dst_lookup: " | ||
| 798 | "no available source address\n"); | ||
| 799 | #endif | ||
| 800 | goto out_err_release; | 796 | goto out_err_release; |
| 801 | } | ||
| 802 | } | 797 | } |
| 803 | 798 | ||
| 804 | return 0; | 799 | return 0; |
