aboutsummaryrefslogtreecommitdiff
path: root/net/ipv6
AgeCommit message (Collapse)AuthorFilesLines
2008-01-28[NETFILTER]: nf_log: constify struct nf_logger and nf_log_packet loginfo argPatrick McHardy1-1/+1
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: nf_log: move logging stuff to seperate headerPatrick McHardy3-0/+3
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ctnetlink: use netlink attribute helpersPatrick McHardy1-12/+6
Use NLA_PUT_BE32, nla_get_be32() etc. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: use raw_smp_processor_id() in do_add_counters()Patrick McHardy1-1/+1
Use raw_smp_processor_id() in do_add_counters() as in ip_tables.c. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: fix stack leagagePatrick McHardy1-1/+1
Fix leakage of local variable on stack. This already got fixed in ip_tables silently by the compat patches. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: {ip,ip6}_tables: fix format stringsPatrick McHardy1-9/+7
Use %zu for sizeof() and remove casts. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: {ip,ip6}_tables: reformat to eliminate differencesPatrick McHardy1-23/+23
Reformat ip_tables.c and ip6_tables.c in order to eliminate non-functional differences and minimize diff output. This allows to get a view of the real differences using: sed -e 's/IP6T/IPT/g' \ -e 's/IP6/IP/g' \ -e 's/INET6/INET/g' \ -e 's/ip6t/ipt/g' \ -e 's/ip6/ip/g' \ -e 's/ipv6/ip/g' \ -e 's/icmp6/icmp/g' \ net/ipv6/netfilter/ip6_tables.c | \ diff -wup /dev/stdin net/ipv4/netfilter/ip_tables.c Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: add compat supportPatrick McHardy1-56/+767
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: resync get_entries() with ip_tablesPatrick McHardy1-19/+18
Resync get_entries() with ip_tables.c by moving the checks from the setsockopt handler to the function itself. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: move IP6T_SO_GET_INFO handling to seperate functionPatrick McHardy1-42/+47
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: move counter allocation to seperate functionPatrick McHardy1-9/+22
More resyncing with ip_tables.c as preparation for compat support. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: use vmalloc_node()Patrick McHardy1-3/+4
Consistently use vmalloc_node for all counter allocations. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: move entry, match and target checks to seperate ↵Patrick McHardy1-47/+82
functions Resync with ip_tables.c as preparation for compat support. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_tables: kill a few useless defines/forward declarationsPatrick McHardy1-14/+2
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[UDP]: Move udp_stats_in6 into net/ipv4/udp.cHerbert Xu1-3/+0
Now that external users may increment the counters directly, we need to ensure that udp_stats_in6 is always available. Otherwise we'd either have to requrie the external users to be built as modules or ipv6 to be built-in. This isn't too bad because udp_stats_in6 is just a pair of pointers plus an EXPORT, e.g., just 40 (16 + 24) bytes on x86-64. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6] sit: Rebinding of SIT tunnels to other interfacesMichal Schmidt1-28/+42
This is similar to the change already done for IPIP tunnels. Once created, a SIT tunnel can't be bound to another device. To reproduce: # create a tunnel: ip tunnel add tunneltest0 mode sit remote 10.0.0.1 dev eth0 # try to change the bounding device from eth0 to eth1: ip tunnel change tunneltest0 dev eth1 # show the result: ip tunnel show tunneltest0 tunneltest0: ipv6/ip remote 10.0.0.1 local any dev eth0 ttl inherit Notice the bound device has not changed from eth0 to eth1. This patch fixes it. When changing the binding, it also recalculates the MTU according to the new bound device's MTU. Signed-off-by: Michal Schmidt <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Always pass a valid nl_info to inet6_rt_notify.Denis V. Lunev2-15/+15
This makes the code in the inet6_rt_notify more straightforward and provides groud for namespace passing. Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: fix section mismatch warningsDaniel Lezcano5-5/+5
Removed useless and buggy __exit section in the different ipv6 subsystems. Otherwise they will be called inside an init section during rollbacking in case of an error in the protocol initialization. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPSEC]: Do not let packets pass when ICMP flag is offHerbert Xu1-2/+5
This fixes a logical error in ICMP policy checks which lets packets through if the state ICMP flag is off. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPSEC]: Make callers of xfrm_lookup to use XFRM_LOOKUP_WAITHerbert Xu4-4/+4
This patch converts all callers of xfrm_lookup that used an explicit value of 1 to indiciate blocking to use the new flag XFRM_LOOKUP_WAIT. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPSEC]: Fix reversed ICMP6 policy checkHerbert Xu1-1/+1
The policy check I added for ICMP on IPv6 is reversed. This patch fixes that. It also adds an skb->sp check so that unprotected packets that fail the policy check do not crash the machine. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPSEC]: Add ICMP host relookup supportHerbert Xu1-4/+56
RFC 4301 requires us to relookup ICMP traffic that does not match any policies using the reverse of its payload. This patch implements this for ICMP traffic that originates from or terminates on localhost. This is activated on outbound with the new policy flag XFRM_POLICY_ICMP, and on inbound by the new state flag XFRM_STATE_ICMP. On inbound the policy check is now performed by the ICMP protocol so that it can repeat the policy check where necessary. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPSEC]: Added xfrm_decode_session_reverse and xfrmX_policy_check_reverseHerbert Xu1-5/+5
RFC 4301 requires us to relookup ICMP traffic that does not match any policies using the reverse of its payload. This patch adds the functions xfrm_decode_session_reverse and xfrmX_policy_check_reverse so we can get the reverse flow to perform such a lookup. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: make the protocol initialization to return an error codeDaniel Lezcano6-60/+159
This patchset makes the different protocols to return an error code, so the af_inet6 module can check the initialization was correct or not. The raw6 was taken into account to be consistent with the rest of the protocols, but the registration is at the same place. Because the raw6 has its own init function, the proto and the ops structure can be moved inside the raw6.c file. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: make inet6_register_protosw to return an error codeDaniel Lezcano1-4/+7
This patch makes the inet6_register_protosw to return an error code. The different protocols can be aware the registration was successful or not and can pass the error to the initial caller, af_inet6. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: make frag to return an error at initializationDaniel Lezcano2-5/+19
This patch makes the frag_init to return an error code, so the af_inet6 module can handle the error. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: make extended headers to return an error at initializationDaniel Lezcano2-28/+46
This patch factorize the code for the differents init functions for rthdr, nodata, destopt in a single function exthdrs_init. This function returns an error so the af_inet6 module can check correctly the initialization. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: make flowlabel to return an errorDaniel Lezcano2-8/+27
This patch makes the flowlab subsystem to return an error code and makes some cleanup with procfs ifdefs. The af_inet6 will use the flowlabel init return code to check the initialization was correct. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NET]: Remove unused "mibalign" argument for snmp_mib_init().YOSHIFUJI Hideaki2-15/+11
With fixes from Arnaldo Carvalho de Melo. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: route6 remove ifdef for fib_rulesDaniel Lezcano1-6/+1
The patch defines the usual static inline functions when the code is disabled for fib6_rules. That's allow to remove some ifdef in route.c file and make the code a little more clear. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: remove ifdef in route6 for xfrm6Daniel Lezcano1-6/+1
The following patch create the usual static inline functions to disable the xfrm6_init and xfrm6_fini function when XFRM is off. That's allow to remove some ifdef and make the code a little more clear. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: create route6 proc init-fini functionsDaniel Lezcano1-18/+40
Make the proc creation/destruction to be a separate function. That allows to remove the #ifdef CONFIG_PROC_FS in the init/fini function and make them more readable. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6] route6/fib6: Don't panic a kmem_cache_create.Daniel Lezcano2-2/+8
If the kmem_cache_creation fails, the kernel will panic. It is acceptable if the system is booting, but if the ipv6 protocol is compiled as a module and it is loaded after the system has booted, do we want to panic instead of just failing to initialize the protocol ? The init function is now returning an error and this one is checked for protocol initialization. So the ipv6 protocol will safely fails. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make af_inet6 to check ip6_route_init return value.Daniel Lezcano1-1/+5
The af_inet6 initialization function does not check the return code of the route initilization, so if something goes wrong, the protocol initialization will continue anyway. This patch takes into account the modification made in the different route's initialization subroutines to check the return value and to make the protocol initialization to fail. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make ip6_route_init to return an error code.Daniel Lezcano1-11/+53
The route initialization function does not return any value to notify if the initialization is successful or not. This patch checks all calls made for the initilization in order to return a value for the caller. Unfortunately, proc_net_fops_create will return a NULL pointer if CONFIG_PROC_FS is off, so we can not check the return code without an ifdef CONFIG_PROC_FS block in the ip6_route_init function. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make fib6_rules_init to return an error code.Daniel Lezcano1-3/+16
When the fib_rules initialization finished, no return code is provided so there is no way to know, for the caller, if the initialization has been successful or has failed. This patch fix that. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make xfrm6_init to return an error code.Daniel Lezcano2-7/+19
The xfrm initialization function does not return any error code, so if there is an error, the caller can not be advise of that. This patch checks the return code of the different called functions in order to return a successful or failed initialization. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make fib6_init to return an error code.Daniel Lezcano1-3/+11
If there is an error in the initialization function, nothing is followed up to the caller. So I add a return value to be set for the init function. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NET]: Multiple namespaces in the all dst_ifdown routines.Denis V. Lunev2-3/+7
Move dst entries to a namespace loopback to catch refcounting leaks. Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[UDP]: Only increment counter on first peek/recvHerbert Xu1-2/+5
The previous move of the the UDP inDatagrams counter caused each peek of the same packet to be counted separately. This may be undesirable. This patch fixes this by adding a bit to sk_buff to record whether this packet has already been seen through skb_recv_datagram. We then only increment the counter when the packet is seen for the first time. The only dodgy part is the fact that skb_recv_datagram doesn't have a good way of returning this new bit of information. So I've added a new function __skb_recv_datagram that does return this and made skb_recv_datagram a wrapper around it. The plan is to eventually replace all uses of skb_recv_datagram with this new function at which time it can be renamed its proper name. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[UDP]: Restore missing inDatagrams incrementsHerbert Xu2-0/+3
The previous move of the the UDP inDatagrams counter caused the counting of encapsulated packets, SUNRPC data (as opposed to call) packets and RXRPC packets to go missing. This patch restores all of these. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[UDP]: Avoid repeated counting of checksum errors due to peekingHerbert Xu1-2/+2
Currently it is possible for two processes to peek on the same socket and end up incrementing the error counter twice for the same packet. This patch fixes it by making skb_kill_datagram return whether it succeeded in unlinking the packet and only incrementing the counter if it did. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Eliminate difference in actions of sysctl and proc handler for ↵Pavel Emelyanov1-36/+20
conf.all.forwarding The only difference in this case is that updating all.forwarding causes the update in default.forwarding when done via proc, but not via the system call. Besides, this consolidates a good portion of code. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Use sysctl paths to register ipv6 sysctl tablesPavel Emelyanov1-20/+6
I have already done this for core, ipv4 and tr tables, so repeat this for the ipv6 ones. This makes the ipv6.ko smaller and creates the ground needed for net namespaces support in ipv6.ko ssctls. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[IPV6]: Make the ipv6/sysctl_net_ipv6.c compilation cleanerPavel Emelyanov2-9/+2
Since this file is entirely enclosed with the #ifdef CONFIG_SYSCTL/#endif pair, it's OK to move this CONFIG_ into a Makefile. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: {nfnetlink,ip,ip6}_queue: kill issue_verdictPatrick McHardy1-10/+2
Now that issue_verdict doesn't need to free the queue entries anymore, all it does is disable local BHs and call nf_reinject. Move the BH disabling to the okfn invocation in nf_reinject and kill the issue_verdict functions. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: nf_queue: move list_head/skb/id to struct nf_infoPatrick McHardy2-50/+31
Move common fields for queue management to struct nf_info and rename it to struct nf_queue_entry. The avoids one allocation/free per packet and simplifies the code a bit. Alternatively we could add some private room at the tail, but since all current users use identical structs this seems easier. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_queue: resync dev-index based flushingPatrick McHardy1-1/+10
Resync dev_cmp to take bridge devices into account. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: ip6_queue: deobfuscate entry lookupsPatrick McHardy1-64/+37
A queue entry lookup currently looks like this: ipq_find_dequeue_entry -> __ipq_find_dequeue_entry -> __ipq_find_entry -> cmpfn -> id_cmp Use simple open-coded list walking and kill the cmpfn for ipq_find_dequeue_entry. Instead add it to ipq_flush (after similar cleanups) and use ipq_flush for both complete flushes and flushing entries related to a device. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28[NETFILTER]: {nf_netlink,ip,ip6}_queue: use list_for_each_entryPatrick McHardy1-5/+3
Use list_add_tail/list_for_each_entry instead of list_add and list_for_each_prev as a preparation for switching to RCU. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>