Changeset 313824a in mainline for uspace/srv/net/inetsrv/inet_link.c


Ignore:
Timestamp:
2013-07-16T17:05:30Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f97352
Parents:
fc4bf2a
Message:

all fragments of a packet need to have the same identifier (thx Antonin Steinhauser)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/inet_link.c

    rfc4bf2a r313824a  
    5252static bool first_link6 = true;
    5353
     54static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);
     55static uint16_t ip_ident = 0;
     56
    5457static int inet_link_open(service_id_t);
    5558static int inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, uint16_t);
     
    366369        packet.proto = proto;
    367370        packet.ttl = ttl;
     371       
     372        /* Allocate identifier */
     373        fibril_mutex_lock(&ip_ident_lock);
     374        packet.ident = ++ip_ident;
     375        fibril_mutex_unlock(&ip_ident_lock);
     376       
    368377        packet.df = df;
    369378        packet.data = dgram->data;
    370379        packet.size = dgram->size;
    371380       
     381        int rc;
    372382        size_t offs = 0;
    373         int rc;
    374383       
    375384        do {
     
    421430        packet.proto = proto;
    422431        packet.ttl = ttl;
     432       
     433        /* Allocate identifier */
     434        fibril_mutex_lock(&ip_ident_lock);
     435        packet.ident = ++ip_ident;
     436        fibril_mutex_unlock(&ip_ident_lock);
     437       
    423438        packet.df = df;
    424439        packet.data = dgram->data;
Note: See TracChangeset for help on using the changeset viewer.