syncookies.c (55fa518867978e1f5fd8353098f80d125ac734d7) syncookies.c (284904aa79466a4736f4c775fdbe5c7407fa136c)
1/*
2 * Syncookies implementation for the Linux kernel
3 *
4 * Copyright (C) 1997 Andi Kleen
5 * Based on ideas by D.J.Bernstein and Eric Schenk.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 274 unchanged lines hidden (view full) ---

283 if (tcp_opt.saw_tstamp)
284 cookie_check_timestamp(&tcp_opt);
285
286 ret = NULL;
287 req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */
288 if (!req)
289 goto out;
290
1/*
2 * Syncookies implementation for the Linux kernel
3 *
4 * Copyright (C) 1997 Andi Kleen
5 * Based on ideas by D.J.Bernstein and Eric Schenk.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 274 unchanged lines hidden (view full) ---

283 if (tcp_opt.saw_tstamp)
284 cookie_check_timestamp(&tcp_opt);
285
286 ret = NULL;
287 req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */
288 if (!req)
289 goto out;
290
291 if (security_inet_conn_request(sk, skb, req)) {
292 reqsk_free(req);
293 goto out;
294 }
295 ireq = inet_rsk(req);
296 treq = tcp_rsk(req);
297 treq->rcv_isn = ntohl(th->seq) - 1;
298 treq->snt_isn = cookie;
299 req->mss = mss;
300 ireq->loc_port = th->dest;
301 ireq->rmt_port = th->source;
302 ireq->loc_addr = ip_hdr(skb)->daddr;

--- 14 unchanged lines hidden (view full) ---

317
318 ireq->opt = kmalloc(opt_size, GFP_ATOMIC);
319 if (ireq->opt != NULL && ip_options_echo(ireq->opt, skb)) {
320 kfree(ireq->opt);
321 ireq->opt = NULL;
322 }
323 }
324
291 ireq = inet_rsk(req);
292 treq = tcp_rsk(req);
293 treq->rcv_isn = ntohl(th->seq) - 1;
294 treq->snt_isn = cookie;
295 req->mss = mss;
296 ireq->loc_port = th->dest;
297 ireq->rmt_port = th->source;
298 ireq->loc_addr = ip_hdr(skb)->daddr;

--- 14 unchanged lines hidden (view full) ---

313
314 ireq->opt = kmalloc(opt_size, GFP_ATOMIC);
315 if (ireq->opt != NULL && ip_options_echo(ireq->opt, skb)) {
316 kfree(ireq->opt);
317 ireq->opt = NULL;
318 }
319 }
320
321 if (security_inet_conn_request(sk, skb, req)) {
322 reqsk_free(req);
323 goto out;
324 }
325
325 req->expires = 0UL;
326 req->retrans = 0;
327
328 /*
329 * We need to lookup the route here to get at the correct
330 * window size. We should better make sure that the window size
331 * hasn't changed since we received the original syn, but I see
332 * no easy way to do this.

--- 32 unchanged lines hidden ---
326 req->expires = 0UL;
327 req->retrans = 0;
328
329 /*
330 * We need to lookup the route here to get at the correct
331 * window size. We should better make sure that the window size
332 * hasn't changed since we received the original syn, but I see
333 * no easy way to do this.

--- 32 unchanged lines hidden ---