···859 if (repl->valid_hooks & (1 << i))860 if (check_chainloops(newinfo->hook_entry[i],861 cl_s, udc_cnt, i, newinfo->entries)) {862- if (cl_s)863- vfree(cl_s);864 return -EINVAL;865 }866···882 EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,883 ebt_cleanup_entry, &i);884 }885- if (cl_s)886- vfree(cl_s);887 return ret;888}889···1028 }1029 vfree(table);10301031- if (counterstmp)1032- vfree(counterstmp);1033 return ret;10341035free_unlock:···1037 EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,1038 ebt_cleanup_entry, NULL);1039free_counterstmp:1040- if (counterstmp)1041- vfree(counterstmp);1042 /* can be initialized in translate_table() */1043 if (newinfo->chainstack) {1044 for (i = 0; i < num_possible_cpus(); i++)···1045 vfree(newinfo->chainstack);1046 }1047free_entries:1048- if (newinfo->entries)1049- vfree(newinfo->entries);1050free_newinfo:1051- if (newinfo)1052- vfree(newinfo);1053 return ret;1054}1055···1207 down(&ebt_mutex);1208 LIST_DELETE(&ebt_tables, table);1209 up(&ebt_mutex);1210- if (table->private->entries)1211- vfree(table->private->entries);1212 if (table->private->chainstack) {1213 for (i = 0; i < num_possible_cpus(); i++)1214 vfree(table->private->chainstack[i]);
···859 if (repl->valid_hooks & (1 << i))860 if (check_chainloops(newinfo->hook_entry[i],861 cl_s, udc_cnt, i, newinfo->entries)) {862+ vfree(cl_s);0863 return -EINVAL;864 }865···883 EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,884 ebt_cleanup_entry, &i);885 }886+ vfree(cl_s);0887 return ret;888}889···1030 }1031 vfree(table);10321033+ vfree(counterstmp);01034 return ret;10351036free_unlock:···1040 EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,1041 ebt_cleanup_entry, NULL);1042free_counterstmp:1043+ vfree(counterstmp);01044 /* can be initialized in translate_table() */1045 if (newinfo->chainstack) {1046 for (i = 0; i < num_possible_cpus(); i++)···1049 vfree(newinfo->chainstack);1050 }1051free_entries:1052+ vfree(newinfo->entries);01053free_newinfo:1054+ vfree(newinfo);01055 return ret;1056}1057···1213 down(&ebt_mutex);1214 LIST_DELETE(&ebt_tables, table);1215 up(&ebt_mutex);1216+ vfree(table->private->entries);01217 if (table->private->chainstack) {1218 for (i = 0; i < num_possible_cpus(); i++)1219 vfree(table->private->chainstack[i]);
···130 */131static void poll_napi(struct netpoll *np)132{133+ struct netpoll_info *npinfo = np->dev->npinfo;134 int budget = 16;135136 if (test_bit(__LINK_STATE_RX_SCHED, &np->dev->state) &&137+ npinfo->poll_owner != smp_processor_id() &&138+ spin_trylock(&npinfo->poll_lock)) {139+ npinfo->rx_flags |= NETPOLL_RX_DROP;140 atomic_inc(&trapped);141142 np->dev->poll(np->dev, &budget);143144 atomic_dec(&trapped);145+ npinfo->rx_flags &= ~NETPOLL_RX_DROP;146+ spin_unlock(&npinfo->poll_lock);147 }148}149···245static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)246{247 int status;248+ struct netpoll_info *npinfo;249250repeat:251 if(!np || !np->dev || !netif_running(np->dev)) {···253 }254255 /* avoid recursion */256+ npinfo = np->dev->npinfo;257+ if (npinfo->poll_owner == smp_processor_id() ||258+ np->dev->xmit_lock_owner == smp_processor_id()) {259 if (np->drop)260 np->drop(skb);261 else···341342static void arp_reply(struct sk_buff *skb)343{344+ struct netpoll_info *npinfo = skb->dev->npinfo;345 struct arphdr *arp;346 unsigned char *arp_ptr;347 int size, type = ARPOP_REPLY, ptype = ETH_P_ARP;348 u32 sip, tip;349+ unsigned long flags;350 struct sk_buff *send_skb;351+ struct netpoll *np = NULL;352353+ spin_lock_irqsave(&npinfo->rx_lock, flags);354+ if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev)355+ np = npinfo->rx_np;356+ spin_unlock_irqrestore(&npinfo->rx_lock, flags);357+358+ if (!np)359+ return;360361 /* No arp on this interface */362 if (skb->dev->flags & IFF_NOARP)···429 int proto, len, ulen;430 struct iphdr *iph;431 struct udphdr *uh;432+ struct netpoll *np = skb->dev->npinfo->rx_np;433434+ if (!np)435 goto out;436 if (skb->dev->type != ARPHRD_ETHER)437 goto out;···611{612 struct net_device *ndev = NULL;613 struct in_device *in_dev;614+ struct netpoll_info *npinfo;615+ unsigned long flags;0616617 if (np->dev_name)618 ndev = dev_get_by_name(np->dev_name);···624 }625626 np->dev = ndev;627+ if (!ndev->npinfo) {628+ npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);629+ if (!npinfo)630+ goto release;631+632+ npinfo->rx_np = NULL;633+ npinfo->poll_lock = SPIN_LOCK_UNLOCKED;634+ npinfo->poll_owner = -1;635+ npinfo->rx_lock = SPIN_LOCK_UNLOCKED;636+ } else637+ npinfo = ndev->npinfo;638639 if (!ndev->poll_controller) {640 printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",···692 np->name, HIPQUAD(np->local_ip));693 }694695+ if (np->rx_hook) {696+ spin_lock_irqsave(&npinfo->rx_lock, flags);697+ npinfo->rx_flags |= NETPOLL_RX_ENABLED;698+ npinfo->rx_np = np;699+ spin_unlock_irqrestore(&npinfo->rx_lock, flags);700+ }701+ /* last thing to do is link it to the net device structure */702+ ndev->npinfo = npinfo;703704 return 0;705706 release:707+ if (!ndev->npinfo)708+ kfree(npinfo);709 np->dev = NULL;710 dev_put(ndev);711 return -1;···706707void netpoll_cleanup(struct netpoll *np)708{709+ struct netpoll_info *npinfo;710+ unsigned long flags;711+712+ if (np->dev) {713+ npinfo = np->dev->npinfo;714+ if (npinfo && npinfo->rx_np == np) {715+ spin_lock_irqsave(&npinfo->rx_lock, flags);716+ npinfo->rx_np = NULL;717+ npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;718+ spin_unlock_irqrestore(&npinfo->rx_lock, flags);719+ }720+ dev_put(np->dev);721+ }722+723 np->dev = NULL;724}725
+1-1
net/ipv4/netfilter/ipt_CLUSTERIP.c
···339 * error messages (RELATED) and information requests (see below) */340 if ((*pskb)->nh.iph->protocol == IPPROTO_ICMP341 && (ctinfo == IP_CT_RELATED 342- || ctinfo == IP_CT_IS_REPLY+IP_CT_IS_REPLY))343 return IPT_CONTINUE;344345 /* ip_conntrack_icmp guarantees us that we only have ICMP_ECHO,
···339 * error messages (RELATED) and information requests (see below) */340 if ((*pskb)->nh.iph->protocol == IPPROTO_ICMP341 && (ctinfo == IP_CT_RELATED 342+ || ctinfo == IP_CT_RELATED+IP_CT_IS_REPLY))343 return IPT_CONTINUE;344345 /* ip_conntrack_icmp guarantees us that we only have ICMP_ECHO,
···19 * mar/20/00 Daniela Squassoni Disabling/enabling of facilities20 * negotiation.21 * jun/24/01 Arnaldo C. Melo use skb_queue_purge, cleanups0022 */2324#include <linux/kernel.h>···129 len += 1 + X25_ADDR_LEN + X25_MAX_FAC_LEN +130 X25_MAX_CUD_LEN;131 break;132- case X25_CALL_ACCEPTED:133- len += 1 + X25_MAX_FAC_LEN + X25_MAX_CUD_LEN;0000134 break;135 case X25_CLEAR_REQUEST:136 case X25_RESET_REQUEST:···209 x25->vc_facil_mask);210 dptr = skb_put(skb, len);211 memcpy(dptr, facilities, len);212- dptr = skb_put(skb, x25->calluserdata.cudlength);213- memcpy(dptr, x25->calluserdata.cuddata,214- x25->calluserdata.cudlength);0000000215 x25->calluserdata.cudlength = 0;216 break;217···365 x25_write_internal(sk, X25_RR);366 x25_stop_timer(sk);367 }368-}369-370-/*371- * Compare 2 calluserdata structures, used to find correct listening sockets372- * when call user data is used.373- */374-int x25_check_calluserdata(struct x25_calluserdata *ours, struct x25_calluserdata *theirs)375-{376- int i;377- if (ours->cudlength != theirs->cudlength)378- return 0;379-380- for (i=0;i<ours->cudlength;i++) {381- if (ours->cuddata[i] != theirs->cuddata[i]) {382- return 0;383- }384- }385- return 1;386}387
···19 * mar/20/00 Daniela Squassoni Disabling/enabling of facilities20 * negotiation.21 * jun/24/01 Arnaldo C. Melo use skb_queue_purge, cleanups22+ * apr/04/15 Shaun Pereira Fast select with no23+ * restriction on response.24 */2526#include <linux/kernel.h>···127 len += 1 + X25_ADDR_LEN + X25_MAX_FAC_LEN +128 X25_MAX_CUD_LEN;129 break;130+ case X25_CALL_ACCEPTED: /* fast sel with no restr on resp */131+ if(x25->facilities.reverse & 0x80) {132+ len += 1 + X25_MAX_FAC_LEN + X25_MAX_CUD_LEN;133+ } else {134+ len += 1 + X25_MAX_FAC_LEN;135+ }136 break;137 case X25_CLEAR_REQUEST:138 case X25_RESET_REQUEST:···203 x25->vc_facil_mask);204 dptr = skb_put(skb, len);205 memcpy(dptr, facilities, len);206+207+ /* fast select with no restriction on response208+ allows call user data. Userland must209+ ensure it is ours and not theirs */210+ if(x25->facilities.reverse & 0x80) {211+ dptr = skb_put(skb,212+ x25->calluserdata.cudlength);213+ memcpy(dptr, x25->calluserdata.cuddata,214+ x25->calluserdata.cudlength);215+ }216 x25->calluserdata.cudlength = 0;217 break;218···352 x25_write_internal(sk, X25_RR);353 x25_stop_timer(sk);354 }000000000000000000355}356