aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2006-05-26 16:06:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-05-26 16:06:58 -0400
commitf587fb74b26a10354f1eb73e8d054cd15e5a2fe2 (patch)
treea453a270fc86ada85d808487c911387739ce2296 /net
parentdf8ccb9bf1ca360581a94c2245efb9fa613fbb29 (diff)
parent705af309505681f197f81618440954d10f120dc0 (diff)
Merge branch 'from-linus' into upstream
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br.c3
-rw-r--r--net/ipv4/ipcomp.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c36
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c16
-rw-r--r--net/ipv4/xfrm4_policy.c2
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/irda/iriap.c3
-rw-r--r--net/sunrpc/cache.c1
-rw-r--r--net/xfrm/xfrm_input.c2
9 files changed, 37 insertions, 30 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 22d806cf40ca..12da21afb9ca 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -55,7 +55,7 @@ static int __init br_init(void)
55 55
56static void __exit br_deinit(void) 56static void __exit br_deinit(void)
57{ 57{
58 llc_sap_close(br_stp_sap); 58 rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
59 59
60#ifdef CONFIG_BRIDGE_NETFILTER 60#ifdef CONFIG_BRIDGE_NETFILTER
61 br_netfilter_fini(); 61 br_netfilter_fini();
@@ -67,6 +67,7 @@ static void __exit br_deinit(void)
67 67
68 synchronize_net(); 68 synchronize_net();
69 69
70 llc_sap_put(br_stp_sap);
70 br_fdb_get_hook = NULL; 71 br_fdb_get_hook = NULL;
71 br_fdb_put_hook = NULL; 72 br_fdb_put_hook = NULL;
72 73
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index cd810f41af1a..95278b22b669 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -210,7 +210,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
210 skb->h.icmph->code != ICMP_FRAG_NEEDED) 210 skb->h.icmph->code != ICMP_FRAG_NEEDED)
211 return; 211 return;
212 212
213 spi = ntohl(ntohs(ipch->cpi)); 213 spi = htonl(ntohs(ipch->cpi));
214 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, 214 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr,
215 spi, IPPROTO_COMP, AF_INET); 215 spi, IPPROTO_COMP, AF_INET);
216 if (!x) 216 if (!x)
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
index 355a53a5b6cd..26dfecadb335 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
@@ -528,14 +528,15 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
528 528
529 /* Decode */ 529 /* Decode */
530 if ((err = (Decoders[son->type]) (bs, son, base, 530 if ((err = (Decoders[son->type]) (bs, son, base,
531 level + 1)) > 531 level + 1)) <
532 H323_ERROR_STOP) 532 H323_ERROR_NONE)
533 return err; 533 return err;
534 534
535 bs->cur = beg + len; 535 bs->cur = beg + len;
536 bs->bit = 0; 536 bs->bit = 0;
537 } else if ((err = (Decoders[son->type]) (bs, son, base, 537 } else if ((err = (Decoders[son->type]) (bs, son, base,
538 level + 1))) 538 level + 1)) <
539 H323_ERROR_NONE)
539 return err; 540 return err;
540 } 541 }
541 542
@@ -554,7 +555,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
554 555
555 /* Decode the extension components */ 556 /* Decode the extension components */
556 for (opt = 0; opt < bmp2_len; opt++, i++, son++) { 557 for (opt = 0; opt < bmp2_len; opt++, i++, son++) {
557 if (son->attr & STOP) { 558 if (i < f->ub && son->attr & STOP) {
558 PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ", 559 PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ",
559 son->name); 560 son->name);
560 return H323_ERROR_STOP; 561 return H323_ERROR_STOP;
@@ -584,8 +585,8 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
584 beg = bs->cur; 585 beg = bs->cur;
585 586
586 if ((err = (Decoders[son->type]) (bs, son, base, 587 if ((err = (Decoders[son->type]) (bs, son, base,
587 level + 1)) > 588 level + 1)) <
588 H323_ERROR_STOP) 589 H323_ERROR_NONE)
589 return err; 590 return err;
590 591
591 bs->cur = beg + len; 592 bs->cur = beg + len;
@@ -660,18 +661,20 @@ int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level)
660 i < 661 i <
661 effective_count ? 662 effective_count ?
662 base : NULL, 663 base : NULL,
663 level + 1)) > 664 level + 1)) <
664 H323_ERROR_STOP) 665 H323_ERROR_NONE)
665 return err; 666 return err;
666 667
667 bs->cur = beg + len; 668 bs->cur = beg + len;
668 bs->bit = 0; 669 bs->bit = 0;
669 } else 670 } else
670 if ((err = (Decoders[son->type]) (bs, son, 671 if ((err = (Decoders[son->type]) (bs, son,
671 i < effective_count ? 672 i <
672 base : NULL, 673 effective_count ?
673 level + 1))) 674 base : NULL,
674 return err; 675 level + 1)) <
676 H323_ERROR_NONE)
677 return err;
675 678
676 if (base) 679 if (base)
677 base += son->offset; 680 base += son->offset;
@@ -735,13 +738,14 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
735 } 738 }
736 beg = bs->cur; 739 beg = bs->cur;
737 740
738 if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) > 741 if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) <
739 H323_ERROR_STOP) 742 H323_ERROR_NONE)
740 return err; 743 return err;
741 744
742 bs->cur = beg + len; 745 bs->cur = beg + len;
743 bs->bit = 0; 746 bs->bit = 0;
744 } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1))) 747 } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) <
748 H323_ERROR_NONE)
745 return err; 749 return err;
746 750
747 return H323_ERROR_NONE; 751 return H323_ERROR_NONE;
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index c62253845538..c33244263b90 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -768,6 +768,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
768 len *= sizeof(unsigned long); 768 len *= sizeof(unsigned long);
769 *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); 769 *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
770 if (*obj == NULL) { 770 if (*obj == NULL) {
771 kfree(lp);
771 kfree(id); 772 kfree(id);
772 if (net_ratelimit()) 773 if (net_ratelimit())
773 printk("OOM in bsalg (%d)\n", __LINE__); 774 printk("OOM in bsalg (%d)\n", __LINE__);
@@ -1003,12 +1004,12 @@ static unsigned char snmp_trap_decode(struct asn1_ctx *ctx,
1003 1004
1004 return 1; 1005 return 1;
1005 1006
1007err_addr_free:
1008 kfree((unsigned long *)trap->ip_address);
1009
1006err_id_free: 1010err_id_free:
1007 kfree(trap->id); 1011 kfree(trap->id);
1008 1012
1009err_addr_free:
1010 kfree((unsigned long *)trap->ip_address);
1011
1012 return 0; 1013 return 0;
1013} 1014}
1014 1015
@@ -1126,11 +1127,10 @@ static int snmp_parse_mangle(unsigned char *msg,
1126 struct snmp_v1_trap trap; 1127 struct snmp_v1_trap trap;
1127 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); 1128 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check);
1128 1129
1129 /* Discard trap allocations regardless */ 1130 if (ret) {
1130 kfree(trap.id); 1131 kfree(trap.id);
1131 kfree((unsigned long *)trap.ip_address); 1132 kfree((unsigned long *)trap.ip_address);
1132 1133 } else
1133 if (!ret)
1134 return ret; 1134 return ret;
1135 1135
1136 } else { 1136 } else {
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index f285bbf296e2..8604c747bca5 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -221,7 +221,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
221 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 221 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
222 u16 *ipcomp_hdr = (u16 *)xprth; 222 u16 *ipcomp_hdr = (u16 *)xprth;
223 223
224 fl->fl_ipsec_spi = ntohl(ntohs(ipcomp_hdr[1])); 224 fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
225 } 225 }
226 break; 226 break;
227 default: 227 default:
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 05eb67def39f..48636436028a 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -208,7 +208,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
208 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) 208 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
209 return; 209 return;
210 210
211 spi = ntohl(ntohs(ipcomph->cpi)); 211 spi = htonl(ntohs(ipcomph->cpi));
212 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); 212 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6);
213 if (!x) 213 if (!x)
214 return; 214 return;
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 254f90746900..2d2e2b1919f4 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -544,7 +544,8 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
544{ 544{
545 struct sk_buff *tx_skb; 545 struct sk_buff *tx_skb;
546 int n; 546 int n;
547 __u32 tmp_be32, tmp_be16; 547 __u32 tmp_be32;
548 __be16 tmp_be16;
548 __u8 *fp; 549 __u8 *fp;
549 550
550 IRDA_DEBUG(4, "%s()\n", __FUNCTION__); 551 IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 3ac4193a78ed..7026b0866b7b 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -159,6 +159,7 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail,
159 detail->update(tmp, new); 159 detail->update(tmp, new);
160 tmp->next = *head; 160 tmp->next = *head;
161 *head = tmp; 161 *head = tmp;
162 detail->entries++;
162 cache_get(tmp); 163 cache_get(tmp);
163 is_new = cache_fresh_locked(tmp, new->expiry_time); 164 is_new = cache_fresh_locked(tmp, new->expiry_time);
164 cache_fresh_locked(old, 0); 165 cache_fresh_locked(old, 0);
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b54971059f16..891a6090cc09 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq)
62 case IPPROTO_COMP: 62 case IPPROTO_COMP:
63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) 63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr)))
64 return -EINVAL; 64 return -EINVAL;
65 *spi = ntohl(ntohs(*(u16*)(skb->h.raw + 2))); 65 *spi = htonl(ntohs(*(u16*)(skb->h.raw + 2)));
66 *seq = 0; 66 *seq = 0;
67 return 0; 67 return 0;
68 default: 68 default: