[IPCOMP]: Disable BH on output when using shared tfm
[cascardo/linux.git] / net / ipv4 / ip_options.c
index 2513468..4d31515 100644 (file)
@@ -151,7 +151,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
                                                __be32 addr;
 
                                                memcpy(&addr, sptr+soffset-1, 4);
-                                               if (inet_addr_type(addr) != RTN_LOCAL) {
+                                               if (inet_addr_type(&init_net, addr) != RTN_LOCAL) {
                                                        dopt->ts_needtime = 1;
                                                        soffset += 8;
                                                }
@@ -400,7 +400,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
                                        {
                                                __be32 addr;
                                                memcpy(&addr, &optptr[optptr[2]-1], 4);
-                                               if (inet_addr_type(addr) == RTN_UNICAST)
+                                               if (inet_addr_type(&init_net, addr) == RTN_UNICAST)
                                                        break;
                                                if (skb)
                                                        timeptr = (__be32*)&optptr[optptr[2]+3];
@@ -513,11 +513,8 @@ void ip_options_undo(struct ip_options * opt)
 
 static struct ip_options *ip_options_get_alloc(const int optlen)
 {
-       struct ip_options *opt = kmalloc(sizeof(*opt) + ((optlen + 3) & ~3),
-                                        GFP_KERNEL);
-       if (opt)
-               memset(opt, 0, sizeof(*opt));
-       return opt;
+       return kzalloc(sizeof(struct ip_options) + ((optlen + 3) & ~3),
+                      GFP_KERNEL);
 }
 
 static int ip_options_get_finish(struct ip_options **optp,