]> err.no Git - linux-2.6/blobdiff - net/ipv4/af_inet.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux...
[linux-2.6] / net / ipv4 / af_inet.c
index 5882a13164418bb29ed985181009d0b6514d5a79..f2b5270efdaaa4e056cff85624662fc853e79775 100644 (file)
@@ -1077,7 +1077,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)
 
        if (sysctl_ip_dynaddr > 1) {
                printk(KERN_INFO "%s(): shifting inet->"
-                                "saddr from %d.%d.%d.%d to %d.%d.%d.%d\n",
+                                "saddr from " NIPQUAD_FMT " to " NIPQUAD_FMT "\n",
                       __func__,
                       NIPQUAD(old_saddr),
                       NIPQUAD(new_saddr));
@@ -1250,6 +1250,29 @@ out:
        return segs;
 }
 
+int inet_ctl_sock_create(struct sock **sk, unsigned short family,
+                        unsigned short type, unsigned char protocol,
+                        struct net *net)
+{
+       struct socket *sock;
+       int rc = sock_create_kern(family, type, protocol, &sock);
+
+       if (rc == 0) {
+               *sk = sock->sk;
+               (*sk)->sk_allocation = GFP_ATOMIC;
+               /*
+                * Unhash it so that IP input processing does not even see it,
+                * we do not wish this socket to see incoming packets.
+                */
+               (*sk)->sk_prot->unhash(*sk);
+
+               sk_change_net(*sk, net);
+       }
+       return rc;
+}
+
+EXPORT_SYMBOL_GPL(inet_ctl_sock_create);
+
 unsigned long snmp_fold_field(void *mib[], int offt)
 {
        unsigned long res = 0;