diff options
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 5882a1316441..7ab0bd64c9d1 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1250,6 +1250,25 @@ out: | |||
1250 | return segs; | 1250 | return segs; |
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | int inet_ctl_sock_create(struct socket **sock, unsigned short family, | ||
1254 | unsigned short type, unsigned char protocol) | ||
1255 | { | ||
1256 | int rc = sock_create_kern(family, type, protocol, sock); | ||
1257 | |||
1258 | if (rc == 0) { | ||
1259 | (*sock)->sk->sk_allocation = GFP_ATOMIC; | ||
1260 | inet_sk((*sock)->sk)->uc_ttl = -1; | ||
1261 | /* | ||
1262 | * Unhash it so that IP input processing does not even see it, | ||
1263 | * we do not wish this socket to see incoming packets. | ||
1264 | */ | ||
1265 | (*sock)->sk->sk_prot->unhash((*sock)->sk); | ||
1266 | } | ||
1267 | return rc; | ||
1268 | } | ||
1269 | |||
1270 | EXPORT_SYMBOL_GPL(inet_ctl_sock_create); | ||
1271 | |||
1253 | unsigned long snmp_fold_field(void *mib[], int offt) | 1272 | unsigned long snmp_fold_field(void *mib[], int offt) |
1254 | { | 1273 | { |
1255 | unsigned long res = 0; | 1274 | unsigned long res = 0; |