~as-s/helenos/ipv6

« back to all changes in this revision

Viewing changes to uspace/srv/net/tcp/ucall.c

  • Committer: Anthony Steinhauser
  • Date: 2013-07-08 01:07:36 UTC
  • Revision ID: as@strmilov.cz-20130708010736-pbvrszhamp0v64ez
HelenOS networking stack supports IPv6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (c) 2011 Jiri Svoboda
 
3
 * Copyright (c) 2013 Antonin Steinhauser
3
4
 * All rights reserved.
4
5
 *
5
6
 * Redistribution and use in source and binary forms, with or without
297
298
{
298
299
        tcp_conn_t *conn;
299
300
 
300
 
        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_as_segment_arrived(f:(%x,%u), l:(%x,%u))",
301
 
            sp->foreign.addr.s_addr, sp->foreign.port,
302
 
            sp->local.addr.s_addr, sp->local.port);
 
301
        log_msg(LOG_DEFAULT, LVL_DEBUG,
 
302
            "tcp_as_segment_arrived(f:(%u), l:(%u))",
 
303
            sp->foreign.port, sp->local.port);
303
304
 
304
305
        conn = tcp_conn_find_ref(sp);
305
306
        if (conn == NULL) {
318
319
                return;
319
320
        }
320
321
 
321
 
        if (conn->ident.foreign.addr.s_addr == INADDR_ANY)
322
 
                conn->ident.foreign.addr.s_addr = sp->foreign.addr.s_addr;
 
322
        if (in6addr_equal(&conn->ident.foreign.addr, &in6addr_any))
 
323
                conn->ident.foreign.addr = sp->foreign.addr;
323
324
        if (conn->ident.foreign.port == TCP_PORT_ANY)
324
325
                conn->ident.foreign.port = sp->foreign.port;
325
 
        if (conn->ident.local.addr.s_addr == INADDR_ANY)
326
 
                conn->ident.local.addr.s_addr = sp->local.addr.s_addr;
 
326
        if (in6addr_equal(&conn->ident.local.addr, &in6addr_any))
 
327
                conn->ident.local.addr = sp->local.addr;
327
328
 
328
329
        tcp_conn_segment_arrived(conn, seg);
329
330