/* Call get/setsockopt() */
static int nf_sockopt(struct sock *sk, int pf, int val,
- char *opt, int *len, int get)
+ char __user *opt, int *len, int get)
{
struct list_head *i;
struct nf_sockopt_ops *ops;
return ret;
}
-int nf_setsockopt(struct sock *sk, int pf, int val, char *opt,
+int nf_setsockopt(struct sock *sk, int pf, int val, char __user *opt,
int len)
{
return nf_sockopt(sk, pf, val, opt, &len, 0);
}
-int nf_getsockopt(struct sock *sk, int pf, int val, char *opt, int *len)
+int nf_getsockopt(struct sock *sk, int pf, int val, char __user *opt, int *len)
{
return nf_sockopt(sk, pf, val, opt, len, 1);
}
unsigned int verdict;
int ret = 0;
- if (skb->ip_summed == CHECKSUM_HW) {
- if (outdev == NULL) {
- skb->ip_summed = CHECKSUM_NONE;
- } else {
- skb_checksum_help(skb);
- }
- }
-
/* We may already have this, but read-locks nest anyway */
rcu_read_lock();
/* DaveM says protocol headers are also modifiable. */
switch ((*pskb)->nh.iph->protocol) {
case IPPROTO_TCP: {
- struct tcphdr hdr;
- if (skb_copy_bits(*pskb, (*pskb)->nh.iph->ihl*4,
- &hdr, sizeof(hdr)) != 0)
+ struct tcphdr _hdr, *hp;
+ hp = skb_header_pointer(*pskb, (*pskb)->nh.iph->ihl*4,
+ sizeof(_hdr), &_hdr);
+ if (hp == NULL)
goto copy_skb;
- if (writable_len <= (*pskb)->nh.iph->ihl*4 + hdr.doff*4)
+ if (writable_len <= (*pskb)->nh.iph->ihl*4 + hp->doff*4)
goto pull_skb;
goto copy_skb;
}
nf_logfn *logfn;
rcu_read_lock();
- logfn = nf_logging[pf];
+ logfn = rcu_dereference(nf_logging[pf]);
if (logfn) {
va_start(args, fmt);
vsnprintf(prefix, sizeof(prefix), fmt, args);
va_end(args);
/* We must read logging before nf_logfn[pf] */
- smp_read_barrier_depends();
logfn(hooknum, skb, in, out, prefix);
} else if (!reported) {
printk(KERN_WARNING "nf_log_packet: can\'t log yet, "
tracking in use: without this, connection may not be in hash table,
and hence manufactured ICMP or RST packets will not be associated
with it. */
-void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *);
+void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *);
void __init netfilter_init(void)
{